Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Percent of total instead of sum

I have a pivot table with Customer (rows) and Account Type (columns) as my dimensions. If I sum Accounts (measure) in my expression, I get a sum of Accounts for each intersection, which is fine. However, the client also wants to see a percentage of Accounts by Account Type for each customer. How would I calculate the percentage of Accounts by Account type for each Customer?

4 Replies
johnw
Champion III
Champion III

If I understood:

sum(Accounts)/sum(total <"Account Type"> Accounts)

If that's not it, perhaps:

sum(Accounts)/sum(total <"Customer"> Accounts)

I wasn't clear which total you were trying to divide by.

Not applicable
Author

Thanks John. I actually found this in help earlier in the day but again you're spot on!

Kevin

Not applicable
Author

What if you want the percent by three different dimensions... division, salesperson, quarter?

johnw
Champion III
Champion III

sum(Accounts)/sum(total <division,salesperson,quarter> Accounts)