Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How do I calculate percentage in Qlik sense?
Ex.
Percentage = # of Objects
# of Objects + # of Objects2
Let's say we had a bunch of athletes that were either a Rugby player or a Baseball player, we could do something like the following.
COUNT({<[Object Type]={'BaseballPlayer'}>} ObjectId) /
COUNT({<[Object Type]={'BaseballPlayer'}>} ObjectId) + COUNT({<[Object Type]={'RugbyPlayer'}>} ObjectId)
Percentage = # of Objects /
( # of Objects + # of Objects2 )
Do you mean percentage contribution to the whole amount?
If so, you would have a dimension, such as Store, in a table and then have an expression like this:
sum(Sales) / sum(TOTAL Sales)
You would then need to use the Number format to tell Sense that this is a percentage.
If you want a Margin % it would be something like;
(sum(Sales) - sum(Cost)) / sum(Sales)
Hope that helps point you in the right direction?
Steve