Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rmuhammad
Creator
Creator

last 13 months up to user selection

Hi All

what would be set analysis statement for selecting last 13 month from the select Year and month. Please see attached image what I want to do.

analysis.png

Thanks

Rashid

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Something like:

Count( {<YEAR, MONTH, Period={">=$(=Date(MonthStart(Max(Period),-13)))  <=$(=Date(Max(Period)))"}>} Measure)

Edit: removed redundant addmonths()

View solution in original post

5 Replies
Anonymous
Not applicable

hi 

try this expression dis will work  acoording to ur feilds .

=Sum({<OrderDate={">=$(=(MonthStart(Max(OrderDate),-12)))<=$(=MonthEnd(Max(OrderDate),-12)"},Year=,Month=>} [Opportunity Amount])

tresesco
MVP
MVP

Something like:

Count( {<YEAR, MONTH, Period={">=$(=Date(MonthStart(Max(Period),-13)))  <=$(=Date(Max(Period)))"}>} Measure)

Edit: removed redundant addmonths()

prma7799
Master III
Master III

Hi tresesco‌,

Why we can't use Addmonths here??

like this MonthStart(AddMonths(max([Date]),-13))

tresesco
MVP
MVP

You can. But when you get the same output with a less function, why overkill?

MonthStart(AddMonths(max([Date]),-13))

and

MonthStart(max([Date]),-13)


return the same output.

rmuhammad
Creator
Creator
Author

Hi Tresesco

Thank you for your help. Can you please just break down statement in portion and explain what portion is doing what? So me and others new comers can learn from it.

Count(  is doing count of MEASURE

>{<YEAR, MONTH,  ????

Period={">=$(=Date(MonthStart(Max(Period),-13))) ????? -13 is period 05-2016, so its period is greater then 05-2016. what is $(=Date(MonthStart(Max doing here?

<=$(=Date(Max(Period)))"}>} ???? period selection is 05-2017, so it is less then equal to 05-2017 or what ever is selected

Measure)  is measure