Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
magdalenatudose
Creator
Creator

Show two values in bar chart, in Qlik Sense

How can i show in bar chart two values (value & percentage), in Qlik Sense?

Thank you!

Magdalena
1 Solution

Accepted Solutions
OmarBenSalem

Well you can add it in the dimension, like we already did:

=[OICA region]&'/Sales:'&aggr(num((Sum({1}[Car sales])/Sum({1}total [Car sales])),'# ##0,00%'),[OICA region])

&'/Prod:'&aggr(num((Sum({1}[Car production])/Sum({1}total [Car production])),'# ##0,00%'),[OICA region])

result:

Capture.PNG

The other way to do, to have to have both the measure and its % in the same chart; is to use a combined chart:

Capture.PNG

Example:

dimension: "Oica Region"

Measure 1 : sum(Car Sales)

Capture.PNG

Measure 2:

Sum("Car Sales") / sum( total "Car Sales") , format it as % ,choose a representation other than Bars (sthing different from the first  measure representation) and select "secondary axis"

Capture.PNG

result:

Capture.PNG

View solution in original post

6 Replies
OmarBenSalem

You can add the % besides the dimension values:

Capture.PNG

Example:

Dimension:

=[region]&' '&aggr(num((Sum([Car sales])/Sum({1}total [Car sales])),'# ##0,00%'),[region])

Measure:

sum("Car sales")

magdalenatudose
Creator
Creator
Author

Hi Omar,

Thank you for your answer!

I have one dimension and more many measure on the same chart. How can I see for each other value & percentage?

Thank you!

Magdalena

Magdalena
OmarBenSalem

Well you can add it in the dimension, like we already did:

=[OICA region]&'/Sales:'&aggr(num((Sum({1}[Car sales])/Sum({1}total [Car sales])),'# ##0,00%'),[OICA region])

&'/Prod:'&aggr(num((Sum({1}[Car production])/Sum({1}total [Car production])),'# ##0,00%'),[OICA region])

result:

Capture.PNG

The other way to do, to have to have both the measure and its % in the same chart; is to use a combined chart:

Capture.PNG

Example:

dimension: "Oica Region"

Measure 1 : sum(Car Sales)

Capture.PNG

Measure 2:

Sum("Car Sales") / sum( total "Car Sales") , format it as % ,choose a representation other than Bars (sthing different from the first  measure representation) and select "secondary axis"

Capture.PNG

result:

Capture.PNG

magdalenatudose
Creator
Creator
Author

Hi Omar,

Thank you!!

Magdalena

Magdalena
Not applicable

here I would like to extend the question asked earlier.

My question is how to display relative percentage ?(i.e., display percentage only with the current selections,  not by taking all the whole dimension values)

For example,in the above chart if I selected only Africa, Americans, Europe the percentage for Europe should be displayed only by considering the selection items but not all items that are loaded in that dimension.

Thanks in advance !!

OmarBenSalem

If your measure is for example : sum(Sales) and your dimension is Region:

just do as follow:

sum(Sales) / sum( Total {<Region>} Sales)