Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Accumulate timestamp-wise and find max/min for each date

Hi,

I need to ackumulate cashflows in time order to see the balance peaks and lows for each date.

Should be a rather simple exercise but for some reason I cannot get i right.

Any ideas?

Samle file attached.

Kind Regards,

Olle

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

Change in the script to get cumulative sum

Load Date,Timestamp,Amount,If(Date <> Previous(Date),Amount,Amount+Peek(CumSum)) As CumSum Resident Initial Order by Timestamp;

View solution in original post

19 Replies
anbu1984
Master III
Master III

Is this your expected output?

Not applicable
Author

Hi Anbu,

thanks for your answer.

However, to receive the balance we need to ackumulate the cash flows coming in/going out.

In other words CF1+CF2+CF3+CF4+CF5 and so on and so on. Then find the daily max/min.

Please find attached source data. I've done some calcs in there.  Expected output as per below:

Max 1-Apr504,573.27
Min 1-Apr-349,900.00
Max 2-Apr20,006,667.80
Min 2-Apr-2,600,000.00

Thanks in advance,

Olle

Not applicable
Author

And here comed the attachment!
//O

ashfaq_haseeb
Champion III
Champion III

Is this what you are looking at?

Regards

ASHFAQ

Not applicable
Author

I'm afraid not Ashfac, please see the excel file to see what I'm looking for

Not lookin for the largest/smallest transactions. Rather the min/max running balance.

Kind Regards,

Olle

anbu1984
Master III
Master III

Check this

Not applicable
Author

Hi anbu!

Thanks for your answer. Your suggested solution works assuming the input data is sorted in the correct order, which is not the case for me unfortunatley. Pls see attached. I reloaded data using your app, but I sorted the input data on value instead of date, which messed up the numbers pretty bad.

I need the app to return the correct figures, no matter the input sort order, any ideas?

Best Regards,

Olle

anbu1984
Master III
Master III

I still see my script ordered on date in the attached app. Can you post what you tried and expected output for loaded date

Not applicable
Author

Sorry,

attached the wrong qv-file.

Here comes the correct one.

result should still be the same:

Max 1-Apr504,573.27
Min 1-Apr-349,900.00
Max 2-Apr20,006,667.80
Min 2-Apr

-2,600,000.00

Thanks in advance,

Olle