Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
sum(myNumber)/sum(total{1} myNumber) :
If you want the "totaux' to always be 10 no matter your selection :
change your sum(myNumber) to :
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
Fixed it.
Just notice Qlik sense function is case sensitive sometimes.
sum(myNumber)/sum(total{1} myNumber) :
If you want the "totaux' to always be 10 no matter your selection :
change your sum(myNumber) to :
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
Hi Omar, thanks for your help! I used a similar expression and fix it.
Please close the discussion
OK. Thanks!