Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

mahitham
Contributor

Percentage calculation

Hi Experts,

Can any please help me on Below requirement.

I have a  pivot table like below from Measure please help me to calculate the Percentage column

Dimension            Measure(Count(ID))                  Percentage

Sales     

Product 1               43                                              -

Product 2               21                                             21/43 = 48.84%

Product 3               22                                             22/43=51.16%

Division

Product 1               4                                              -

Product 2               1                                            1/4 = 25.00%

Product 3               3                                             3/4=75.00%


Thanks in advance

1 Solution

Accepted Solutions

Re: Percentage calculation

Try this

Sum({<Dim2 -= {'Product1'}>} Ids)/Sum(TOTAL <Dim1> {<Dim2 = {'Product1'}>} Ids)


Capture.PNG

4 Replies

Re: Percentage calculation

May be this

Count(ID)/Count(TOTAL {<Division = {'Product 1'}>} ID)

or

Count({<Division -= {'Product 1'}>} ID)/Count(TOTAL {<Division = {'Product 1'}>} ID)

ahmar811
Contributor III

Re: Percentage calculation

Try,

Count(ID)/max(Total Count(ID))



mahitham
Contributor

Re: Percentage calculation

Hi Sunny,

Thanks for your reply. I have tried both expression which you have mentioned. But those are not working. Please find the below attached sample app with expected output.

Here Dim1 Division Product1 sum need to use for dividing remaining two products same like Dim1 Sales Product1 sum need to use for dividing remaining two products.


Please help me on this.

Thanks in advance.

Percentage.png

Re: Percentage calculation

Try this

Sum({<Dim2 -= {'Product1'}>} Ids)/Sum(TOTAL <Dim1> {<Dim2 = {'Product1'}>} Ids)


Capture.PNG

Community Browser