Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
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
Contributor III
Contributor III

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])

Highlighted
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

Highlighted
Master III
Master III

Hi tresesco‌,

Why we can't use Addmonths here??

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

Highlighted
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.

Highlighted
Creator
Creator

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