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

Announcements
Congratulations to the new Qlik Luminary and Partner Ambassador class! Meet them here
cancel
Showing results for 
Search instead for 
Did you mean: 
andrelfg
Contributor
Contributor

Current year vs previous year cumulative sales

Hi all, good evening,

I need to compare the cumulative sales between a year and the year before. This for many years stored in my database.

The sales had already been normalized by the month of each year.

This is the expression I created to generate the information for each year:

Aggr(RangeSum(Above(Sum(QTY), 0, RowNo())), [SALES YEAR, [YEAR/MONTH])

YEAR/MONTH SALES YEAR QTY
(other year months) ... ...
2026/01 2024 1
2026/02 2024 10
2026/03 2024 25
2026/04 2024 8
2026/05 2024 14
... ... ...
2026/01 2025 0
2026/02 2025 3
2026/03 2025 12
2026/04 2025 11
2026/05 2025 7
... ... ...
2026/01 2026 4
2026/02 2026 5
2026/03 2026 8
2026/04 2026 12
2026/05 2026 20

 

And this is the generated graphic:

andrelfg_0-1786559771694.png

 

What I need is to created a new graphic that shows, for each year, the % growth between that year vs its last year, using the same rule (acumulated sales for each month).

I have already tried many solutions here in the topics, but I couldn't get the right result.

For exemple: Aggr(RangeSum(Above(Sum(QTY) / Sum({<[SALES YEAR] = {"$(=Only([SALES YEAR])-1)"}>}QTY), 0, RowNo())), [SALES YEAR, [YEAR/MONTH])

Thanks in advance for any help.

 

Labels (2)
2 Replies
Anil_Babu_Samineni
MVP
MVP

try this way?

((Aggr(Max(RangeSum(Above(Sum(QTY),0,RowNo()))),[SALES YEAR]) - Above(Aggr(Max(RangeSum(Above(Sum(QTY),0,RowNo()))),[SALES YEAR]),1)) / Above(Aggr(Max(RangeSum(Above(Sum(QTY),0,RowNo()))),[SALES YEAR]),1)) * 100

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
andrelfg
Contributor
Contributor
Author

Hi @Anil_Babu_Samineni ,

I tried your solution but it didn't work.

I will try to send more details about my data set, to try to clarify better the issue.

I will send this next monday.

Thanks in advance for your help!