Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Sum the next 3 months from last year based on today's date

Hi Community

I need the sum values please for the next 3 months from last year based on today's date

So, we are November 2018, my model should then pick  December 2017, Jan 2018, Feb 2018 figures, Sum these up and i need the total for forecast budgeting

Example

Date Quantity
'
.
.
30/10/2017 40
10/11/2017 90
15/12/2017 50
15/01/2018 30
25/01/2018 70
21/02/2018 20
25/02/2018 10
27/02/2018 60
13/03/2018 30
.
.
.
.

So if i reload the model now,  The model should give me a total of 240 [ Dec 2017 + Jan 2018 + Feb 2018 ]

I want this figure to be column where the calculation is done in SQL section  please not on the object

 

Tags (1)
2 Replies
Highlighted
Partner
Partner

Re: Sum the next 3 months from last year based on today's date

It would be sthing like:

sum({<Date={">=$(=addmonths(date(today(1)),-12))<=$(=addmonths(date(today(1)),-10))"}>}Measure)

Highlighted
Master
Master

Re: Sum the next 3 months from last year based on today's date

Try Creating Month-Year field in your script and then use it in your presentation layer for calculation.