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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Transforming integer to percentage in pie chart

Hello everyone,

I am trying to convert number to percentage in a pie chart, which i have 3 expressions:

sum([Baby Boomers])

sum(X)

sum(Y)

In the Expression tab, when i select the relative box, all results are 100%:

pie.jpg

If i unselect the relative box and set the percentage in the Number tab, the results are wrong:

pie.jpg

Below is the chart with the original numbers:

pie.jpg

How can i convert the numbers above to the correct percentage?

Regards

12 Replies
Not applicable
Author

Rodrigo,


try this:


sum({<[Generations]={"Regional"}>}[Baby Boomers]) / sum({<[Generations]={"Regional"}>}[Baby Boomers] + X + Y


sum({<[Generations]={"Regional"}>}) / sum({<[Generations]={"Regional"}>}[Baby Boomers] + X + Y))


sum({<[Generations]={"Regional"}>}) / sum({<[Generations]={"Regional"}>}[Baby Boomers] + X + Y)

Not applicable
Author

Yes settu,

I unchecked relative and set "Fixed to" and "Show in percentage" in Number tab.

MarcoWedel

Hi,

one solution could be either:

QlikCommunity_Thread_193151_Pic1.JPG

QlikCommunity_Thread_193151_Pic2.JPG

(Rangesum() instead of just adding the fields for proper null-value results)

QlikCommunity_Thread_193151_Pic5.JPG

or (without changing your data model) using a calculated dimension and a single expression to be able to use the "relative" option for expressions like already suggested by swuehl‌ (although I think his CrossTable solution results in the better data model for your requirements):

QlikCommunity_Thread_193151_Pic3.JPG

QlikCommunity_Thread_193151_Pic4.JPG

hope this helps

regards

Marco