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

percentage of total with a top-label

State / Quarter Q1 Q2 Total Perc

NY 100 200 300 40%

MN 50 400 450 60%

Total 150 600 750 100%

Perc 67% 33% 100%

How can I make the percentage of total column in a straigth tabel?

Both horzontal as vertical?

2 Replies
johnw
Champion III
Champion III

I can't think of how to show both a regular total and percentage of total at the same time. But I can get you a percentage of total. You'll need partial sums for both State and Quarter. Then you need to detect whether you're in the center of the chart or in a total row/column, which you can do with dimensionality() and secondarydimensionality(). The expression ends up like this:

if(dimensionality() and secondarydimensionality()
,sum(Amount)
,num(sum(Amount)/sum(total Amount),'#,##0%'))

See attached.

johnw
Champion III
Champion III

Ah, I figured out one way to get both. It's a bit of a kluge, and needs some work visually, but it's displaying the right data. Maybe it's good enough. See attached.