Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to convert my dataset to the following structure, can someone please help me out.
Thanks in advance.
Source:
SURVEY_ID | TREND_ID | ANSWER |
101 | 501 | 55 |
101 | 502 | 66 |
101 | 503 | Good |
101 | 504 | very Good |
102 | 501 | 77 |
102 | 502 | 99 |
102 | 503 | Good |
102 | 504 | Good |
103 | 501 | 77 |
103 | 502 | 66 |
103 | 503 | Good |
103 | 504 | Good |
Target state:
SURVEY_ID | 501 | 502 | 503 | 504 |
101 | 55 | 66 | Good | very Good |
102 | 77 | 99 | Good | Good |
103 | 77 | 66 | Good | Good |
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.