Announcements
cancel
Showing results for
Did you mean:
MVP

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

1 Solution

Accepted Solutions
Champion III

I think this

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

if(Dimensionality()=2,

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

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
14 Replies
Master III

Try

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

Regards,

Antonio

Champion III

I think this

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

if(Dimensionality()=2,

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

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
MVP
Author

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%..

MVP

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

MVP
Author

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

MVP

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

MVP
Author

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 !

MVP
Author

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?

MVP

More like this

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