Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
musketeers
Creator
Creator

need help in pivot/unpivot calculation

Hi, I have data like this:

productQuality1Quality2Quality3Quality4Quality5Quality6Quality7
P11010010
P21010010
P31110011
P41010011
P51010101
P61011101
P71011101
P81111101
P90101101
P100101101
P110101101
P120101001
P130111010
P140110010
P151110010
P161110010
P171010010
P181010010
P191011010
P201011010

The number of products can increase or decrease in next load. Now regardless of client, I need to display the Quality descriptions in following way in straight table:

QualityTotal CountTotal - 1Total - 0
Quality120146
Quality2201010
Quality320164
Quality4201010
Quality520713
Quality620128
Quality7201010

Is there any way we can do this.

Any help is much appreciated.

4 Replies
marcus_sommer

Have a look on the crosstable-statement which transformed your crosstable in a data-stream and then is a table-chart in qv very easy.

- Marcus

anbu1984
Master III
Master III

Check this app. Attached app has ValueList for Quality1 and Quality2. You can add for remaining quality

JonnyPoole
Former Employee
Former Employee

Doing a 'crosstable' load will structure the table perfectly.

Use this in the load script:

CrossTable(Quality, Count)

LOAD product,

    Quality1,

    Quality2,

    Quality3,

    Quality4,

    Quality5,

    Quality6,

    Quality7

FROM

[http://community.qlik.com/thread/136432]

(html, codepage is 1252, embedded labels, table is @1);

And then a chart with 'Quality' as dimension and these expressions:

1: sum( if(Count=1,1))

0:  sum( if(Count=0,1))

Total:  sum( if(Count=0 or Count=1,1))

Capture.PNG.png

jyothish8807
Master II
Master II

Hi Rajneesh,

PFA.

Regards

KC

Best Regards,
KC