6 Replies Latest reply on Sep 4, 2018 6:28 PM by Zhouyi Zhang

# Aggregation Problems

Hi Tableau community,

I am having issues understanding aggregation.

I have check my calculated fields and I know that they are correct - however the percentage result i am after is not correct due to the aggregation - but I don't know how to fix my calculations so that i get the correct results.

I have attached a work book so that you can see what I am trying to do.

Basically the calc is the the PVA_PFAT number divided be the result of "Total fleet minus W's " (which is a parameter) so for the 3/09/2018 the calc should be 416/452*.100 = 92.03% but i am getting 92.7%

The 4th Sep should be 419/452*100 = 92.69% but I am getting 93.3%

then the 5th Sep should be 418/452*100 = 92.47% but i am getting 93.1%

I have tried turning off agg measures but that then resembles nothing like i should have.

Any help would be most welcome

• ###### 1. Re: Aggregation Problems

Hi, Caireen

Please see my solution below

The only thing I changed is the order of your elseif statement, put the latest first.

Hope this helps

ZZ

1 of 1 people found this helpful
• ###### 2. Re: Aggregation Problems

Totally surprised you did not give up after first look...

Shin

• ###### 3. Re: Aggregation Problems

Oh wow - thank you, I would never have thought to do that.
But makes complete sense - and good to know as there will be more changes in the coming months.

Cheers

Caireen

• ###### 4. Re: Aggregation Problems

That doesn't give me a lot of confidence with what i have done.....

• ###### 5. Re: Aggregation Problems

Yep, totally agree, I just tried one more time before give it up to see what's the value of [PVA_PFAT] when comment the last line and then noticed it doesn't change from percentage to number.

ZZ

• ###### 6. Re: Aggregation Problems

Don't worry, Caireen, you are doing well with this

ZZ