Forum Discussion

Ian_4-learnin's avatar
Ian_4-learnin
Copper Contributor
Apr 18, 2019
Solved

How to translate data into a longitudinal database

Hello! I've been stuck on this problem for hours. I'm trying to convert data into a longitudinal data-set, and have built an equation that almost does the trick. BTW if there is an easier way to do t...
  • Detlef_Lewin's avatar
    Detlef_Lewin
    Apr 18, 2019

    Ian_4-learnin 

     

    Load Table1 into the PQ editor.

    Select columns person_id and quiz_year. Right click -> unpivot other columns.

    Select column Attribut. Right click -> replace value -> enter quiz_reponse and qr.

    Select column quiz_year. Click on the ABC icon in the header and change the data type into Text.

    Add user defined column. Type this formula: "year_"&[quiz_year]&"_"&[Attribut]

    Select columns quiz_year and Attribut. Right click -> Remove.

    Select column Benutzerdefiniert. Transform -> Pivot column. Select Value column: Wert.

    Select more options: Do not aggregate.

     

    The wording might differ because I use a non-english version and tried to translate.

    Besides "right click" the commands are also available in the ribbon.

     

Resources