Forum Discussion

Rich_100's avatar
Rich_100
Copper Contributor
Jun 23, 2021

Restarting Formulas at Specified Data Points

Hi,   I have a very large data set and need to move all relevant data onto the same row to complete the analysis I am working on. After playing around with it for a while, I have been unable to fin...
  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Jun 24, 2021

    Rich_100 Okay, let's give it a try. You can follow the applied steps in my file. No need to reverse engineer them. But, ignore the query "Table1". I forgot to delete it.

     

    Step 1 was to create a separate table with just the Customer, Age and Gender.

     

    Step 2 is to go back to the same source (Query "Table1 (2)". Remove some unwanted columns. Then merge the query from step 1 with the cleaned-up table in step 2. This will add the Age and Gender to each Customer record. Reorder columns and then, probably the most important step is to select the customer, age and gender columns and then select to "unpivot other columns", Then you get a long list of "records" from which you can filter out the date fields. 

    Now you can merge the "Attribute" and "Value" columns, separated by a colon. Close and load to a table, to create the output that you see in columns M:P. 

     

    Step 3 is to create pivot table from that table (i.e. the end result from Step 2) in order to  give you the condensed view per customer.

     

    As you noticed, PQ has quite a steep learning curve. But once you get over the first hurdles, you'll love it. Good luck!

Resources