3 Replies Latest reply on May 23, 2017 9:48 AM by Dipesh Surana

Calculating Time weighted rate of return(TWRR)

Hi,

I am trying to calculate time weighted rate of return(TWRR) for an index.

The formula I am using is ((1+ percent daily change)*(1+Previous value))-1.

Here, previous value is the TWRR value in the previous row.

While creating the calculated field it doesn't gives me any error, but when I try to drag the field on the rows it shows NULL values everywhere.

Can someone help me figure this out?

I have attached my tableau file.

Dipesh Surana

• 1. Re: Calculating Time weighted rate of return(TWRR)

Hi

I'm not familiar with the financial formula but I think your formula needs to be  (1+ [percent daily change])*(1+PREVIOUS_VALUE([percent daily change]))-1

see below

Let me know if that helped

Jim

• 2. Re: Calculating Time weighted rate of return(TWRR)

Thanks Jim.

But the formula needs the previous value of the same field. Something like self referring itself to its previous value.

TWRR = (1+ [percent daily change])*(1+PREVIOUS_VALUE([TWRR]))-1

• 3. Re: Calculating Time weighted rate of return(TWRR)

Got it. Previous_value(0) or Previous_value(1) works to get the previous value of the same field.

And the NULL error was solved using ZN in the other calculations which makes NULL values change to 0.

Thanks,

Dipesh