Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
OmarBenSalem

Handling pourcentages in a pivot table

Hi all, stalwar1‌ , vinieme12

I have the following table :

Capture.PNG

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

14 Replies
sunny_talwar

Check this link out:

Qlik Tips: No nodistinct

OmarBenSalem
Author

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

sunny_talwar

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

OmarBenSalem
Author

Now we're talking !

vinieme12
Champion III
Champion III

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

When should the Aggr() function NOT be used?

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