8 Replies Latest reply on Mar 27, 2019 12:34 AM by tee online

# Grand Total show incorrect summation When using LOD ?

Hi, everybody

I have a  problem when I use LOD in Calculated Field.

and The Grand Total for FinalValue(Filtered) shows incorrectly

but for P_BTM Field, it show correctly.

Grand Total for P_BTM  = 364,048.11 (Correct)

Grand Total for FinalValue(Filtered) = 364,048.11 (Incorrect) --> It should show 377,367

What should I do to show grand total for Calculated field correctly ?

FinalValue(Filtered) - Calculation Field

Thank you very must

TEE.

• ###### 1. Re: Grand Total show incorrect summation When using LOD ?

Hello tee,

Here's a sample demonstrating how to write the correct calculation.

Regards

Lei

• ###### 2. Re: Grand Total show incorrect summation When using LOD ?

Hi,Lei

I try to do as your sample but i' don't understand why the result for grand total not correct

Grand Total For [Value] = 19,500

Grand Total For [FinalValue] Should shows 35,500

What should I do ?

I'm newly in Tableau

Thank you

Tee.

• ###### 3. Re: Grand Total show incorrect summation When using LOD ?

Hello tee,

Since only a very limited sample data is provide, it's probably that this calculation doen't work for your data.

Regards

Lei

• ###### 4. Re: Grand Total show incorrect summation When using LOD ?

I try to do same as you.

This is my data source

and this is my data pane

Here is the code.

//Copy this code to calculation1

IF ATTR([Region])='Other' THEN

MAX(
{FIXED :SUM(IIF([Region]='North',[Value],0))} //North = 6000
+{FIXED :SUM(IIF([Region]='NULL',[Value],0))}  //NULL = 10,000
+{FIXED :SUM(IIF([Region]='Other',[Value],0))} //Other = 3,500
)

ELSE SUM([Value])
END

--------------------------------------------------------------------------------------------------------------------

//Copy this code to calculation2

IF ATTR([Region]) = 'Other' THEN

[Calculation1]

ELSE
SUM([Value])

END

--------------------------------------------------------------------------------------------------------------------

but it cannot show grand total correctly

Do you have any suggestion for me ?

Thank you very much Lei,

Tee.

• ###### 5. Re: Grand Total show incorrect summation When using LOD ?

Hello tee,

Please refer to the attached workbook.

Regards

Lei

• ###### 6. Re: Grand Total show incorrect summation When using LOD ?

Hello, Lei

Can you attached workbook again ?.

Tee.

• ###### 7. Re: Grand Total show incorrect summation When using LOD ?

Hello tee,

The attachment is not visible if you view the post from you inbox.

https://community.tableau.com/message/899574

Regards

Lei

• ###### 8. Re: Grand Total show incorrect summation When using LOD ?

Hi, Lei