Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

magdalenatudose
New Contributor III

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
Esteemed Contributor

Re: Show two values in bar chart, in Qlik Sense

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

6 Replies
OmarBenSalem
Esteemed Contributor

Re: Show two values in bar chart, in Qlik Sense

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
New Contributor III

Re: Show two values in bar chart, in Qlik Sense

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
Esteemed Contributor

Re: Show two values in bar chart, in Qlik Sense

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
New Contributor III

Re: Show two values in bar chart, in Qlik Sense

Hi Omar,

Thank you!!

Magdalena

Magdalena
Not applicable

Re: Show two values in bar chart, in Qlik Sense

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
Esteemed Contributor

Re: Show two values in bar chart, in Qlik Sense

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

just do as follow:

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

Community Browser