Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Nakul
Contributor
Contributor

How to pivot/unpivot this dataset

I want to convert my dataset to the following structure, can someone please help me out.

Thanks in advance.

 

Source:

SURVEY_IDTREND_IDANSWER
10150155
10150266
101503Good
101504very Good
10250177
10250299
102503Good
102504Good
10350177
10350266
103503Good
103504

Good

 

Target state:

SURVEY_ID501502503504
1015566Goodvery Good
1027799GoodGood
1037766GoodGood

 

 

Labels (2)
2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

There's no need to transform the data in script. Just create a pivot table with SURVEY_ID  (row) and TREND_ID (column) as dimensions, and Only(ANSWER) as the expression/measure. In Qlikview, pivot the TREND_ID by dragging it to the top.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein