Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate average percent change for multiple months

Hi,

The requirements I have are to calculate a percent change between the current month and prior months values. Then also calculate the YTD average change for all months in the year.

So if my data looks like this...

MonthCurrent Month
Dec50
Jan55
Feb60
Mar65

My Percent change for March would be (65-60)/65 = 7.69%. And the table for the year would look as such:

MonthCurrent MonthPrior Month% Change
Dec50--
Jan55509.09%
Feb60558.33%
Mar65607.69%

My calculate for percent change is something similar to:

(SUM({$<Month = {$(=Only(Month))}>}  - SUM({$<Month = {$(=Only(Month) - 1)}>} )/ SUM({$<Month = {$(=Only(Month))}>}

Now they want to get the average YTD change percent. So the YTD change for Feb would be (9.09+8.33)/2 = 8.71%. And I would end up with this table:

MonthCurrent MonthPrior Month% ChangeAvg YTD % change
Dec50---
Jan55509.09%9.09%
Feb60558.33%8.71%
Mar65607.69%8.37%

Now the question comes in. How can I calculate this Avg YTD % change using QlikView? I would imagine it owuld need to be something like

avg(

     aggr(

          (Calculate % change),

          [Month]

     )

)

but i am not sure how to calculate the % change correctly when doing this over all months. Any help would be appreciated.


Thanks in advanced

0 Replies