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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pivot table % Totals

Hi all,

I have a pivot table as shown below. there is an expression which calculates the % which is working per line but the subtotals and totals are not working. (As you can see it shows 33.33% for each.

Does anyone know how i can fix this please?

The expressions used are ..

Score

Sum(Score)

Percentage

=sum(Score)/sum({<City=>}(aggr(NODISTINCT sum( Score), Country)))

Capture.JPG

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try:

if(Dimensionality()=3, sum(Score)/sum(total <Country,Continent> Score),

if(Dimensionality()=2, sum(Score)/sum(total <Continent> Score),

sum(Score)/sum(total Score)))


talk is cheap, supply exceeds demand

View solution in original post

7 Replies
Not applicable
Author

Hi

Try this:

=sum(Score)/sum(TOTAL<City> aggr(sum(Score),Continent,Country, City))

TMF

Message was edited by: tmendesf

Not applicable
Author

Hi TMF,

That works for the totals but now each line reports as 100% as below

Capture.JPG

Not applicable
Author

Hi

Try this:

=sum(Score)/sum(TOTAL<City> aggr(sum(Score),Continent,Country))

TMF

Not applicable
Author

Hi, thanks again but now im getting some lines reporting nothing..

Nottingham for example should be reporting 20/35*100 =  57.14% but is showing -

Capture.JPG

Not applicable
Author

Can you post a sample file?

Not applicable
Author

Hi, yes here is a sample

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try:

if(Dimensionality()=3, sum(Score)/sum(total <Country,Continent> Score),

if(Dimensionality()=2, sum(Score)/sum(total <Continent> Score),

sum(Score)/sum(total Score)))


talk is cheap, supply exceeds demand