Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 |
Thanks in advance,
Steve
=SUM({<,YourDateField =, YourMonthField = , YourQuarterField =, YourYearField = ,YearMonth = {">=$(=Date(AddMonths(Date#(Max(YearMonth),'YYYYMM'),11),'YYYYMM'))<=$(=Max(YearMonth))"}>}Sales)
=SUM({<,YourDateField =, YourMonthField = , YourQuarterField =, YourYearField = ,YearMonth = {">=$(=Date(AddMonths(Date#(Max(YearMonth),'YYYYMM'),11),'YYYYMM'))<=$(=Max(YearMonth))"}>}Sales)
Thanks!!
Steve
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? 🙂
Create a new Question/Thread please !
I got it! Thx
(After trying 50 times) 🙂