Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
LLing
Creator
Creator

Percentage based on dimension in pivot table

Hi,

I have a pivot table with dimensions MonthYear, Category and Item. I want to create a percentage column defined as the item amount divided by the item category amount. 

Example: Amount for Item Apple / Amount for Fruits Category will give me 33.33% in the percentage column. Screenshot (652).png

 

I tried the below expression but it is not working. 

Sum(Amount)/ Aggr(Sum(Amount),MonthYear,Category)

Any suggestion on how to create the percentage column please. Thank you.

Labels (2)
1 Solution

Accepted Solutions
rubenmarin

Hi, you can use the TOTAL qualifier to tell the expression to ignore dimensions, and between <> tell wich dimension it has to use, so this can be:

Sum(Amount)/Sum(TOTAL <CategoryFieldName> Amount)

View solution in original post

2 Replies
rubenmarin

Hi, you can use the TOTAL qualifier to tell the expression to ignore dimensions, and between <> tell wich dimension it has to use, so this can be:

Sum(Amount)/Sum(TOTAL <CategoryFieldName> Amount)

View solution in original post

LLing
Creator
Creator
Author

Hi @rubenmarin ,

Your solution works perfectly well. Thank you very much!