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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
lavanya_gurrapu
Contributor III
Contributor III

Pie Chart for Multiple Columns

Hi,

I am facing the below issue for Pie chart.

I have 5 columns with Data ex: A1,A2,A3,A4,A5. Now need to build pie chart. Here is the data for these columns.

A1A2A3A4A5
ABABA
BDCCB
CEEAC
D    
E    

 

Pie chart should have count of all A's(5 Columns),B's,C's,D's,E's.

A - 4

B - 4

C - 4

D - 2

E - 3

Can any one help me how to do that.

Appreciate for quick help.

 

5 Replies
Vegar
MVP
MVP

You could remodel your table into this format

Type, Class

A1, A

A1, B

A1, C

A1, D

A1, E

A2, B

A2, D

A2, E

ETC...

 

You can accomplish this using the crosstable function.

 

Then you could use Type as a dimension and just count Class in your measure.

Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

A pie chart will not accept more than one measure and it should contain dimension

So try to make the table into 2 columns by using Cross table key word in scripting maybe this will help u to get the output the way you want.

Hope this somewhat helps 

Thanks

Thanks and Regards
Kashyap.R
lavanya_gurrapu
Contributor III
Contributor III
Author

Hi,

Thanks for your suggestion. I have done like below

CrossTable(Test, CNTTest,1)
[Test_Name]:
LOAD
[A1] as K1,
[A2] as K2,
[A3] as K3,
[A4] as K4,
[A5] as K5
Resident [MainTable]
When i created pie chart by giving dimension as Test and measure as CNTTest, it worked. The issue is, i want to display label names as A,B,C,D,E and not K1,K2,K3,K4,K5. Those are actual values of A,B,C,D,E.

Capture.PNG

 

Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

Can u attach a sample qvf or excel I will try and get back to you.

Thanks

Thanks and Regards
Kashyap.R
Vegar
MVP
MVP

What if you use CNTTest as both dimension and measure? 

 

image.png