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

How to SUM data of last 12 months

Hi Qlik Gurus,

I have a Qlikview App which one of its Expressions is being calculated by a variable:

$(vG.Measure.ST.Accum.Rotation.Value.Consumption)

This variable is showing the Consumption of stock of the selected period.

Is it possible to calculate Consumption of last 12 months (of maximum selected date) using this variable by adding any Qlikview function in the expression?

Thanks in advance.

Regards,

Jordi

1 Reply
Anil_Babu_Samineni

We can use this?

Sum({<$(vG.Measure.ST.Accum.Rotation.Value.Consumption), MonthField = {">=$(AddMonths(=Max(MonthField),-3)) <=$(=Max(MonthField))"}>}Sales)

Or

Sum({<MonthField = {">=$(AddMonths(=Max(MonthField),-3)) <=$(=Max(MonthField))"}>} $(vG.Measure.ST.Accum.Rotation.Value.Consumption))

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