none
Slowly Changing Dimension Type 2 RRS feed

  • Question

  • Hi All

     

    I am tracking Student Class changes with an SCD Type 2 Dimension.. When the Class changes the it is given the End Date from the Start Date of the Class that the Student has moved into.

     

    Setup is as follows

     

    I have created 6 queries (1 for each collection) that references stgStudentTeachingGroups and filtered the queries to each collection.

     

    I have a Query called StudentTeachingGroups which uses 01 - StudentTeachingGroups as the Source and is the Filtered Query for Collection 1.

     

    Below is the code for StudentTeachingGroups - It Appends each of the queries 02 to 06 (Each of the Query Processing Section is exactly the same)after processing the SCD2.

     

    How do I create a function using each query as a parameter for the append. I need to pass the APPEND each query let it do the processing then loop to the next query but I cannot figure out how to do this. Below is all the code but I think I should just be able to loop through the first Append until the queries are processed.


    let
        Source = #"01 - StudentTeachingGroups",

        #"Append-Collection02" = Table.Combine({Source, #"02 - StudentTeachingGroups"}),

    ----------- Process Query for Collection 2 ---------------------------

        #"Append-Collection03" = Table.Combine({#"RemoveAllButCurrent-02", #"03 - StudentTeachingGroups"}),

    ----------- Process Query for Collection 3 ---------------------------

        #"Append-Collection04" = Table.Combine({#"RemoveAllButCurrent-03", #"04 - StudentTeachingGroups"}),

    ----------- Process Query for Collection 4 ---------------------------

        #"Append-Collection05" = Table.Combine({#"RemoveAllButCurrent-03", #"05 - StudentTeachingGroups"}),

    ----------- Process Query for Collection 5 ---------------------------

      #"Append-Collection06" = Table.Combine({#"RemoveAllButCurrent-03", #"06 - StudentTeachingGroups"}),

    ----------- Process Query for Collection 6 ---------------------------
     
        #"RemoveAllButCurrent-06"

     

    Thanks

     

    Chris

    Wednesday, January 10, 2018 8:44 AM

Answers