5 Replies Latest reply: Mar 2, 2017 9:16 AM by Haikuo Yu

# How to calculate percentage in Qlik sense

I would like to calculate a percentage in Qlik sense. The data is as:

myNumber:

2

3

5

I would like get a table as:

myNumber   thePercentage

2                   20%

3                   30%

5                    50%

Total  10                  100%

Any suggestion is appreciated!

• ###### Re: How to calculate percentage in Qlik sense

Fixed it.

Just notice Qlik sense function is case sensitive sometimes.

• ###### Re: How to calculate percentage in Qlik sense

sum(myNumber)/sum(total{1} myNumber) :

If you want the "totaux' to always be 10 no matter your selection :

if(Dimensionality()=0,sum(total{1} myNumber), Sum(myNumber))

dimensionality()=0 is the 'total' dimension:

if we had a pivot table, and 3 dimensions: the first dimension is dimensionality()=1 and so on

Hope that helps

• ###### Re: How to calculate percentage in Qlik sense

Hi Omar, thanks for your help! I used a similar expression and fix it.