Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
zahidrahim_ocp
Partner - Creator
Partner - Creator

Calculate Closing Balance and Trend

Dear Experts,

I have below data which i want to calculate all on date selected. and also a trend for 2 dates selected.

Example Data:

Trdate                        Amount

01-JAN-2017                     10

02-JAN-2017                     10

03-JAN-2017                     10

04-JAN-2017                     10

05-JAN-2017                     10

06-JAN-2017                     10

07-JAN-2017                     10


Now if i select 06Jan2017 it should 60 (Sum of all previous records). and if i select 06 and 07-Jan2017 it should show trend:

06-JAN-2017      60

07-JAN-2017      70

Regards,

Zahid Rahim

7 Replies
shraddha_g
Partner - Master III
Partner - Master III

You can use Cumulative sum in this case(Using RangeSum())

arulsettu
Master III
Master III

may be this

RangeSum(above(sum(Amount),0,rowno()))

zahidrahim_ocp
Partner - Creator
Partner - Creator
Author

Dear arul

Thank you for the reply. your expression returns running total without any filter. Applying a filter only shows that current record value only.

Regads,

Zahid Rahim

zahidrahim_ocp
Partner - Creator
Partner - Creator
Author

I want to use it with data filters. Can i have one example please.

antoniotiman
Master III
Master III

Hi,

try this

Sum(Aggr(RangeSum(Top(Sum({<Trdate>} Amount),1,RowNo())),Trdate))

Regards,

Antonio

zahidrahim_ocp
Partner - Creator
Partner - Creator
Author

It keep displaying zero.

antoniotiman
Master III
Master III

LOAD Date(Date#(Trdate,'DD-MMM-YYYY'),'DD-MMM-YYYY') as Trdate,Amount Inline [
Trdate Amount
01-JAN-2017 10
02-JAN-2017 10
03-JAN-2017 10
04-JAN-2017 10
05-JAN-2017 10
06-JAN-2017 10
07-JAN-2017 10
]
(delimiter is
spaces);