Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Percentage calculation on dimension subtotal

Hello experts,

I have this scenario:

In a pivot table with 2 dimensions ("line" and "sector") and the following definition as expression:

=Sum(ImportoOrdinatoRiga) / sum(total ImportoOrdinatoRiga)

the above expression give me the percentage on "line" dimension total (grand total), while I need the percentage on the "sector" dimension total.

How can i achieve it?

thanks in advance.

Best regards

Andrea

5 Replies
Not applicable
Author

Try:

=Sum(ImportoOrdinatoRiga) / sum(total <sector> ImportoOrdinatoRiga)


That should give you the percentage of the sector. The denominator will be the sector total.

Not applicable
Author

i tried it but the results is the same!

Not applicable
Author

The same? That seems odd. What order are your dimensions in?

I actually think you'll need to use:

=Sum(ImportoOrdinatoRiga) / sum(total <line,sector> ImportoOrdinatoRiga)


But the original expression shouldn't have given you the same value as your expression. Try it with just the total sum as an expression.

Not applicable
Author

Please use this

=Sum(ImportoOrdinatoRiga) / sum(total <line> ImportoOrdinatoRiga)
Anonymous
Not applicable
Author

Can we use the same concept in a bar chart?