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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create a pie chart with different column values

I have to create a pie chart with values present in 4 different columns of a straight table. How can I do it? What should be the dimensions and expressions (Also, what are they?). I am attaching an image that gives what values are to be used in the pie chart.20151109_152154.jpg

18 Replies
vincent_ardiet
Specialist
Specialist

As I understand, the sum of Critical, High, Med and Low can be lower than 100?

In this case, you can add a 5th expression which is 100-sum(Critical)-sum(High)-sum(Low)-sum(Med)

So, you have an extra slice to keep the ratio constant and you can set a transparent color to make it disappear.

IAMDV
Master II
Master II

Dheeraj - Why don't you use CrossTable and get them into two columns. Then you can use the Pie Chart as you need it. I think that works better because you don't have to manage new column in future.

Here's a simple video tutorial on how to use CrossTable along with Pros and Cons.

http://qlikshare.com/qlikview-video-tutorial-crosstable-qlikview-transpose-data/


Cheers,

DV

vincent_ardiet
Specialist
Specialist

Just create 5 expressions:

sum(R)

sum(S)

sum(T)

sum(U)

100-sum(R)-sum(S)-sum(T)-sum(U)

rubenmarin

If the expressions are just a Sum() and you want the total we can ignore dimensions and create 4 expressions in the pie chart:

R: Sum(R)/(Sum(R) + Sum(S) + Sum(T) + Sum(U))

S: Sum(S)/(Sum(R) + Sum(S) + Sum(T) + Sum(U))

T: Sum(T)/(Sum(R) + Sum(S) + Sum(T) + Sum(U))

U: Sum(U)/(Sum(R) + Sum(S) + Sum(T) + Sum(U))

That returns the percentage of each over the total, maybe you can precalculate something in the script to improve performance (only if needed)

Not applicable
Author

I can't use a cross table Deepak. That would another data table and my requirements wouldn't want that.

Not applicable
Author

My question is quite straight.

These are the columns:

R     S    T     U

1      1    1     0

0      1    1     0

1      0    0     0

1      1    0     1

------------------

3      3   2     1

I need the totals to be in the pie chart.

R: Sum(R)/(Sum(R) + Sum(S) + Sum(T) + Sum(U))

S: Sum(S)/(Sum(R) + Sum(S) + Sum(T) + Sum(U))

T: Sum(T)/(Sum(R) + Sum(S) + Sum(T) + Sum(U))

U: Sum(U)/(Sum(R) + Sum(S) + Sum(T) + Sum(U))

          OR

sum(R)

sum(S)

sum(T)

sum(U)

100-sum(R)-sum(S)-sum(T)-sum(U)

is not giving me the result.

Not applicable
Author

I was able to get the pie chart using the expressions

R: Sum(R)/(Sum(R) + Sum(S) + Sum(T) + Sum(U))

S: Sum(S)/(Sum(R) + Sum(S) + Sum(T) + Sum(U))

T: Sum(T)/(Sum(R) + Sum(S) + Sum(T) + Sum(U))

U: Sum(U)/(Sum(R) + Sum(S) + Sum(T) + Sum(U))

But when I select the pie, I don't see any change in the corresponding table values and vice-versa. It's like the pie chart is static and not dynamic. Any ideas what's wrong?

Not applicable
Author

I read that a Pie Chart can have only one dimension and only one expression. Is that true? Also, I tried adding 2nd dimension and the data is messed up.

I am attaching  a new image that clearly shows what Fields I have and what I need in the pie chart. Please refer to it and advise accordingly. download.php?image=35a29a04d5

Also, whenever I click on the pie slice, it should give me the respective field data in the table.

Thanks

rubenmarin

That link redirects me to reduceimages.com/index.php?error=image_not_found


I'm not sure to understand your data so it's a good idea to have a look to that image or to have a sample which simulates the problem.