8 Replies Latest reply on Sep 20, 2016 9:41 PM by lei.chen.0

Hi,

I have data as below

I have written a calculated filed as below to calculate percentage (table down).

zn(SUM([Remaining Base])/LOOKUP(SUM([Remaining Base]),FIRST()))

Now i want to write a calculated field to calculate the sum of percentage using table down.

I have used column total which seems to be not working.

Thank You

Hello youthesh,

My solution is to use LOD.

The result looks like,

The two calculated fields I used here are,

[M0]

{ FIXED [Activation Month]:SUM(IIF([Operating Month]="M0",[Remaining Base],0))}

[Percent]

SUM([Remaining Base])/SUM([M0])

Regards.

1 of 1 people found this helpful

Lei Chen

Thank you.. It worked.

Lei Chen

Hello Lei,

I need your help again on the above calculated field.

I have data from M0 to M24  and i want to sum %(percentages) from M0 to M12 only.

Hello YOUTHESH,

Could you please specify the requirements?

I have data from M0 to M24  and i want to sum %(percentages) from M0 to M12 only.

Does this mean,

you want "Percent" for M0 to M12, and for M13 to M24, better shown as something like "-" or blank or null?

Regards.

Lei Chen

I want to sum percentage fro M0 to M12 only, rest can be null or blanks.

Hello YOUTHESH,

[Percent]

IF INT(RIGHT([Operating Month], LEN(Operating Month])-1)) < 13 THEN  SUM([Remaining Base])/SUM([M0]) END

Please be noticed that I just imagined the situation and wrote the calculated field directly here without verifying it in Tableau Desktop,

so there might be error when you apply it in your workbook.

If any error, please provide a sample workbook for further test, if possible.

Regards.

Lei Chen

it is not working.

PFA tableau file (Version 10.0).

Hello YOUTHESH,

I modified the calculations.

Please check the attached workbook for details.

Regards.