7 Replies Latest reply: Nov 27, 2012 10:08 AM by Gysbert Wassenaar

# 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)))

• ###### Re: Pivot table % Totals

Hi

Try this:

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

TMF

Message was edited by: tmendesf

• ###### Re: Pivot table % Totals

Hi TMF,

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

• ###### Re: Pivot table % Totals

Hi

Try this:

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

TMF

• ###### Re: Pivot table % Totals

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 -

• ###### Re: Pivot table % Totals

Can you post a sample file?

• ###### Re: Pivot table % Totals

Hi, yes here is a sample

• ###### Re: Pivot table % Totals

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)))