14 Replies Latest reply: Apr 26, 2017 7:45 AM by Vineeth Pujari

# Handling pourcentages in a pivot table

Hi all, stalwar1 , vinieme12

I have the following table :

I'm using this expression:

if(Dimensionality()=1, sum(Taux)/sum(total Taux),

if(Dimensionality()=2,

sum(Taux) /sum(total Taux) ))

What I want is, when dimensionality()=2, to have sum(Taux) / sum(Taux) of the first dimension; the pourcentage of each plaque % its Type Materiel and not % Total

How to achieve this? Thanks

• ###### Re: Handling pourcentages in a pivot table

Try

Sum(TOTAL <[Type Materiel]> Taux)/Sum(TOTAL Taux)

Regards,

Antonio

• ###### Re: Handling pourcentages in a pivot table

I think this

if(Dimensionality()=1, sum(Taux)/sum(total Taux),

if(Dimensionality()=2,

sum(Taux) /sum(total <[Type Materiel]> Taux) ))

• ###### Re: Handling pourcentages in a pivot table

Yes, based on Antonio's response, this is how I altered my expression as so, But that does not seem to work.

In fact, if I sum( the 0.64%) it would be much greater than 16.29%..

• ###### Re: Handling pourcentages in a pivot table

I think Vineeth's expression is slightly different... try using his expression and I am sure it will work for you

• ###### Re: Handling pourcentages in a pivot table

This is the expression I'm using:

if(Dimensionality()=1, sum(Taux)/sum(total Taux),

if(Dimensionality()=2,

sum(Taux) /sum(total <[Type Materiel]> Taux) ))

• ###### Re: Handling pourcentages in a pivot table

If you want sum of rows to add up to the total... you will need the same denominator for both of them.... In that case your original expression (without needing dimensionality()) would give you that

sum(Taux)/sum(total Taux)

Now when you sum each 0.10... and all... they would sum upto 16.29%.... using different denominator will never give you the sum

• ###### Re: Handling pourcentages in a pivot table

What an idiot I am

This is normal; if I sum them up, the sum would be 100% since they represent 100% of their Material Type..

Haa, and that was so obvious..

Well, thanks guys !

• ###### Re: Handling pourcentages in a pivot table

between,

Sum(TOTAL <[Type Materiel]> Taux)

is like saying

aggr(Sum(TOTAL Taux),[Type Materiel]) ?

Maybe, the syntax of the second expression won't work, but this is what It's doing?

• ###### Re: Handling pourcentages in a pivot table

More like this

Aggr(NODISTINCT Sum(Taux), [Type Materiel])

• ###### Re: Handling pourcentages in a pivot table

When I use this expression, It goes back to 0.10%

• ###### Re: Handling pourcentages in a pivot table

When you use this? (My bad, I forgot to remove TOTAL within Sum....

if(Dimensionality()=1, sum(Taux)/sum(total Taux),

if(Dimensionality()=2,

sum(Taux) /Aggr(NODISTINCT Sum(Taux), [Type Materiel]) ))

• ###### Re: Handling pourcentages in a pivot table

Now we're talking !

• ###### Re: Handling pourcentages in a pivot table

Preferably avoid AGGR() , because we can achieve it using TOTAL keyword