8 Replies Latest reply on Feb 23, 2018 2:34 AM by Aniruddhya Dutta

# Percentage of Total calucation in a table

Hi Gurus,

I want to achieve a  table like below

1. I want to do the percentage of total calculation using LOD or calculated fields instead of using table level calculations.

2. if at all this is not possible using LODs please let me know how to us the table level calculation to achieve this

• ###### 1. Re: Percentage of Total calucation in a table

H Anir,

Find my approach as reference below and stored in attached workbook version 10.3 located in the original thread.

1. Define a UNION

2. NM D1. Customer: if [Table Name]="Sheet1" then [Customer] elseif [Table Name]="Sheet1\$" then "Total" END

3. NM D2. Customer  Name: if [Table Name]="Sheet1" then [Customer Name] elseif [Table Name]="Sheet1\$" then " " END

4. NM M2. %: {fixed [Customer],[Customer Name]:sum([Profit])}/{fixed:sum([Profit])}

5. Drag the required objects to the indicated locations

Regards,

Norbert

• ###### 2. Re: Percentage of Total calucation in a table

Hi Norbert,

Thanks a lot for helping me out. But unfortunately I am not able to view your work book since I have a lower version of tableau.

but can i can understand the LOD. Only I am not sure why you have used the steps 1 and 2 where there are some if else conditions.

Thanks,

Ani

• ###### 3. Re: Percentage of Total calucation in a table

Ani,

On which version are you?

Regards,

Norbert

• ###### 4. Re: Percentage of Total calucation in a table

in my case {fixed [Customer],[Customer Name]:sum([Profit])}/{fixed:sum([Profit])} is returning 0 though the numerator and the denominator part is returning  correct values in the LOD expression.

• ###### 5. Re: Percentage of Total calucation in a table

I am on 10.2.1

• ###### 6. Re: Percentage of Total calucation in a table

Hi Ani,

Find attached workbook in version 10.2

Regards,

Norbert

• ###### 7. Re: Percentage of Total calucation in a table

Hi Norbert,

Thanks a ton.

But the issue that I am facing with LOD expression is the numerator and the denominator are returning proper results. But the moment I am dividing them they are returning  0. Is there any any issue with aggregation in my data set?

• ###### 8. Re: Percentage of Total calucation in a table

Hi Norbert,

I am now able to see the results. I needed to reformat it since the results are very small.