Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
410
Cumulative sum?
posted

Hi - Is there any way to do a cumulative sum?

e.g. in QLIK Sense I can do

rangesum(above( sum(BaseTotalPL), 0, rowno() ))

and what this does is give me a cumulative sum for every row.

Why would I want this? Very simply: I need to be able to show cumulative P&L day by day. e.g. $10 on 1/1, $20 on 1/2, so I would show $10 on 1/1 and $30 on 1/2.

In addition I need to show geometric cumulative ROR day by day, which could be expressed as sum of logarithms.

Parents
No Data
Reply
  • 640
    posted

    Hi,

    Thanks for contacting us.
    You can achieve this by adding a calculated field and using the PREVIOUS function.

    • Add a calculated field (tap + button on the left section for iOS version, on widget editor)
    • Use the expresion: [BaseTotalPL] + PREVIOUS([BaseTotalPL],0)

    With a similar approach, I guess you can reach a valid result for the logarithms case.

    I hope this can help.

    Best regards,
    Christian

Children