5 Replies Latest reply: Oct 1, 2015 4:38 AM by Anita Melbye

# Getting a range in set analysis (variable + 11 months)

There are probably several ways to do but I need to return a sum of sales for a period equal to the value of a Year Month variable + 11 months.

For instance:

Year Month Variable = 201311 (which represents year and month)

Data (yellow represents the 12 months data I need to sum -  201311 through 201410). Obviously the issue is with a Year Month field I can't just add 11 to the variable:

 Company Sales_YearMonth Sales A 201309 5 A 201310 10 A 201311 15 A 201405 20 A 201406 25 A 201408 30 A 201409 35 A 201412 40 A 201501 45 A 201502 50

Steve

• ###### Re: Getting a range in set analysis (variable + 11 months)

=SUM({<,YourDateField =, YourMonthField = , YourQuarterField =, YourYearField = ,YearMonth = {">=\$(=Date(AddMonths(Date#(Max(YearMonth),'YYYYMM'),11),'YYYYMM'))<=\$(=Max(YearMonth))"}>}Sales)

• ###### Re: Getting a range in set analysis (variable + 11 months)

Thanks!!

Steve

• ###### Re: Getting a range in set analysis (variable + 11 months)

Sorry to "steale" this thread, but i just know this answer would help me solve my problem, but I can not get it to work.

Can someone explain it for me, and help me understand :-)

My period is on the format YYYYMM ('acc_period'), and my Sales is amount.

What shall I Write to make this work?

Anyone? :-)