4 Replies Latest reply on Aug 13, 2016 4:02 AM by Rajeev Pandey

# what mistake I m doing with my calculation:Manager having highest Sales

Hi Team,

I was trying to solve the below question and I pretty much solved it also.But my final result is appearing as Blank , dont know what went wrong.

I checked the Filter as well but nothing fishy there, Can anyone please let me know what mistake I am doing,

1)Using Orders and Returns on Global Superstore, identify the Manager whose Region Sales were greater than the Overall Average Sales?

My approach:

I created a Left join as below.

Then I created three Calculated Field as below

Total Sales for a particular region:

Region wise return Sales( Handling NULL values as Well)

% Returned Sales by Overall Sales

Once my calculation is ready, then I dragged “Person” and “Region” Dimension on my Rows and “% Returned Sales by Overall Sales” calculated Field on Column. I got the below result but not able to find the correct answer as it is showing nothing.

• ###### 1. Re: what mistake I m doing with my calculation:Manager having highest Sales

hi Ranjeev,

You're gonna kick yourself here

[Region wise return Sales]

IIF(IFNULL([Returned], 'no')='Yes',[Sales],NULL)

you needed a CAPITAL 'Y' for yes...String calculations are case-sensitive.

One way to, not have to worry about the character case, is to wrap everything in an UPPER()

[Region wise return Sales]

IIF(IFNULL(UPPER([Returned]), 'no')='YES',[Sales],NULL)

1 of 1 people found this helpful
• ###### 2. Re: what mistake I m doing with my calculation:Manager having highest Sales

Thank you Simon Sir.

I am such an idiot, how can I ignore this. This was the must dumbest mistake I ever did.

You seriously saved my sleep. I was so much confused what I did wrong here and struggling alot.You are a truly a genius

Sir, if you have time ,would u please check MakeoverMonday: Week 32- Formatting Issue and provide your valuable insight

• ###### 3. Re: what mistake I m doing with my calculation:Manager having highest Sales

...I've done it many, many times before!!

It's one of the most annoying errors, as if you don't spot it you keep running through the logic again, and again...with the conclusion (as you've detailed here) "This should work"

• ###### 4. Re: what mistake I m doing with my calculation:Manager having highest Sales

You truly stated -"Tableau don't spot it and we keep running through the logic again, and again."

I struggled alot and everytime I was thinking whether there is no data in  my dataset or have I made any mistake in my calculation.

I never thought that "Y" will create a havoc