Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
sankar_ganesh
Partner - Contributor III
Partner - Contributor III

Cross table

Table 1:

ProductMericValueTarget
AAAMetric110
AAAMetric220
AAAMetric330
BBBMetric1100
BBBMetric2200
BBBMetric3300

Table_2:

ProductMetric1Metric2Metric3
AAA102030
BBB100200300

Hi,

I want to convert the table-1 in the table-2 format as specified above. Can anyone give your ideas ?

Thanks,

Sankar

1 Solution

Accepted Solutions
lft
Employee
Employee

Hi Sankar,

PFA the solution to your question

you should copy paste the pivot sub and then call :

CALL fr.qliktech.pivot('Table 1', 'Product', 'Sum', 'MetricValue', 'Target');

You could do it the other way around using the unpivot function

Loic

View solution in original post

3 Replies
Gysbert_Wassenaar

Yes, don't do it in the script. Use a pivot table object with Product and MetricValue as dimensions. Drag the header of MetricValue to the right above the expression so the dimension values are shown horizontally.


talk is cheap, supply exceeds demand
lft
Employee
Employee

Hi Sankar,

PFA the solution to your question

you should copy paste the pivot sub and then call :

CALL fr.qliktech.pivot('Table 1', 'Product', 'Sum', 'MetricValue', 'Target');

You could do it the other way around using the unpivot function

Loic

sankar_ganesh
Partner - Contributor III
Partner - Contributor III
Author

Hi Loic,

Your document gives me the expected results. Thanks a lot!

Cheers,

Sankar