2 Replies Latest reply on Aug 26, 2016 7:49 AM by Michael Hesser

# Table Calculations  in tableau based on lookup functions

hi,

i am trying to do some calculations in tableau

 Unique new1 balance new percent O/P 20 0 300 1 -0.1 270 20 0 300 2 -0.1 243 20 0 300 3 0.9 461.7 20 0 300 4 1.9 1338.93 20 0 300 5 -0.1 1205.037

i want o/p column in tableau

calculation used is for first row it will be = (300*(1+(-0.1))

and for second row is i need to use the output for first row instead of 300 i.e (270*(1+(-0.1))

like that it repeat.

thanks,

Dinesh

• ###### 1. Re: Table Calculations  in tableau based on lookup functions

The formula that you described above doesn't give the numbers in your table - row 3 would be 218, not 461.7. My guess is that something is missing judging from the missing parenthesis.

With that said, what you described can be accomplished with the following calculation:

IF FIRST()==0 THEN 300*(.9) ELSE PREVIOUS_VALUE(-1)*(.9) END

I hope that helps!

• ###### 2. Re: Table Calculations  in tableau based on lookup functions

Hi Dinesh;

Did you want to make the [Percent] dynamic?

With respects to Stephen Rizzo, this worked for me:

PREVIOUS_VALUE(sum([Balance])) * (1+sum({fixed [New]:sum([Percent])}))

Good luck!

1 of 1 people found this helpful