Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

arvindjha2050
New Contributor II

Percentage in Bar Chart

Hello Team,

I have a simple query which i will explain through sample data :

   

GeographySales
US90
UK70
APAC30
MEA10

The requirement is to create a bar chart in Qliksense with below parameters :

Dimension : Geography

Measure : Sales

Current we can enable data points on bar chart which shows the values but we want percentage contribution to be shown besides it like say for US : 90(45%) ,UK : 70(35%) etc etc.

Any help regarding same is highly appreciated.

Thanks & Regards,

Arvind Kumar Jha

8 Replies
sadasiva
Contributor

Re: Percentage in Bar Chart

Hi Arvind,

Use this

Sum({<>} Sales) / Sum(Total{<>} Sales) and make Number Format as % in dimention properties


Regards,

Sadasiva

dan_sullivan
Contributor II

Re: Percentage in Bar Chart

To my knowledge you are unable to do that in qlik sense (control the hover text).  you could create a second measure for the calculation but then would have to have two bars on the chart.

sadasiva
Contributor

Re: Percentage in Bar Chart

I am sorry, i read it wrong. You can use my expression in color by expression option it will give you two measures together.

Hope thos helps.

Regards,

Sadasiva

arvindjha2050
New Contributor II

Re: Percentage in Bar Chart

Hello Sada Shiv,

I created a master measure and wrote the above formula but it did not work.

Thanks,

Arvind

pathiqvd
Contributor III

Re: Percentage in Bar Chart

Hi,

Try this in dimension,

=Geography

&':'&aggr(sum(Sales),Geography)&'('&num(aggr(sum(Sales),Geography)/aggr(sum(all Sales),Geography),'##%')&')'

Regards,

arvind_patil
Valued Contributor III

Re: Percentage in Bar Chart

Hi Arvind ,

Please try below Code:

Sum(Sales) / Sum({1} Sales)   Number format select % in measures


Thanks,

Arvind Patil

vijetasharma
Contributor III

Re: Percentage in Bar Chart

Hi,

Please use Sum(Sales)/Sum(Total Sales) expression in chart measure and change the number format as %.it will give you the expected output.

arvindjha2050
New Contributor II

Re: Percentage in Bar Chart

Hello Lakshmipathi,

Thanks for the reply

The above calculation is correct but when taken as dimension it increases the length of each value of dimension and values are at bottom.

Basically we want value at top something like below value and percentage side by side and geography name at bottom:

Community Browser