5 Replies Latest reply on Feb 23, 2018 3:41 AM by Zhouyi Zhang

# Return to a Date which Running_Sum[Cashflow] = Half value of total Cashflow

Dear All,

I'm running into a problem and I could not figure out even with browsing the community.

Here is the problem,

I got a date and a column of cashflow value,

I need to get the exact Date, when

Running Sum value equals to half value of the total Cashflow,

Here is what I've tried, but no luck,

IF RUNNING_SUM(SUM([Cashflow]))= (SUM([Cashflow])/2) THEN [Date]

The answer should be around 1/1/2076, which cumulative cashflow at 1/1/2076 (\$356,002.5) is HALF of the Total Cashflow (\$712,005)

Thanks a lot,

Best,

Cheng

p.s. Tableau 10.5 twbx file enclosed

• ###### 1. Re: Return to a Date which Running_Sum[Cashflow] = Half value of total Cashflow

Hey,

if i understand this, you want to return date ?

something like this?

Try this calculation:

IF RANK(ABS(([Total Cashflow]/2) - [Running Sum]),'asc')=1 THEN 'True' ELSE 'False' END

where Total Cashflow is:  WINDOW_SUM(SUM([Cashflow]))

and hide "False" value.

attached is sample workbook.

• ###### 2. Re: Return to a Date which Running_Sum[Cashflow] = Half value of total Cashflow

Hi, Cheng

Please find my solution attached as well as steps below

Hope this helps

ZZ

1 of 1 people found this helpful
• ###### 3. Re: Return to a Date which Running_Sum[Cashflow] = Half value of total Cashflow

Hi, Zhouyi,

I think I'm getting close with your help, but there are still some hurdles.

Below is the visualization which is working properly.

However, when I want to go further,

For example, when I want to put the Half-Life Date into another sheet, it won't work.  It will return to the earlier date in the whole digital stream?

Any ideas, thoughts?

Best,

Cheng

• ###### 4. Re: Return to a Date which Running_Sum[Cashflow] = Half value of total Cashflow

Hi, Sunil

This a cash flow for single customer, and I need to visualize a table for all the customers' half-life date

Customer, Cashflow Total, Half-Life Date

A                 \$12,000                  Jun 1, 2017

B                 \$93,939,000           Jun 2, 2023

C                 ...                                ....

Your approach is close, but I still can not get what I want.

Best,

• ###### 5. Re: Return to a Date which Running_Sum[Cashflow] = Half value of total Cashflow

Hi, Cheng

As the calculation uses table calculation based on date field, you need keep this dimension for calculation purpose as well.

See my screenshot below as reference.