Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
nedcliqs
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

 

2 Replies
OmarBenSalem

It would be sthing like:

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

shiveshsingh
Master
Master

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