Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
lg92
Contributor II
Contributor II

Cumulative Sum

Hi,

I have this table

YearDate   Amount
2019          1000
2019          20000
2018         4550
2020         45480
2019         3200
2019         23320
2021        32780
2021        12370
2021         12300
2020        24890
2018         6580
2019          68750
2020         237890
2021         21330
2021        54560

I need to develp a KPI that calculate cumulative sum by years. if i filter year = 2020, the kpi sum 2018 + 2019 + 2020.

Thanks in advanced 

Labels (2)
2 Solutions

Accepted Solutions
agigliotti
MVP
MVP

Hi @lg92 ,

Maybe this:

=Sum( {< YearDate = {"<=$(=Max(YearDate))"} >} Amount )

I hope it can help.

Best Regards

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it

View solution in original post

Taoufiq_Zarra
MVP
MVP

=sum({<YearDate={"<=$(=max(YearDate))"}>} Amount)

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

4 Replies
Taoufiq_Zarra
MVP
MVP

@lg92  like ?

=sum({<YearDate={"<=$(=getfieldselections(YearDate))"}>} Amount)

 

example :

Taoufiq_Zarra_0-1615198604952.png

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
lg92
Contributor II
Contributor II
Author

This solution works only if i select one year. I need that works also if i don't select any year (in this case kpi sum 2018 +2019+2020+2021 as default).
anyway thank you

agigliotti
MVP
MVP

Hi @lg92 ,

Maybe this:

=Sum( {< YearDate = {"<=$(=Max(YearDate))"} >} Amount )

I hope it can help.

Best Regards

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
Taoufiq_Zarra
MVP
MVP

=sum({<YearDate={"<=$(=max(YearDate))"}>} Amount)

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉