Qlik Community

Ask a Question

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
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

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