Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted

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