QlikView Default selection trigger - previous + current year minus current month

539 Views Asked by At

I want to create a sheet trigger to select the previous year and the current year but not the current month.

If for example we were in 201604...

Sample data is as follows:

201511

201512

201601

201602

201603

201604

Selection I would want would be:

201511

201512

201601

201602

201603
1

There are 1 best solutions below

0
Matt On BEST ANSWER

In the Trigger expression you can use the YearStart function along with the MAX function to get all of the previous year plus the current years months excluding the current month.

='<' & Max(YearMonth) & '>=' & Num#(Date(YearStart(Max(Date#(YearMonth, 'YYYYMM')), -1), 'YYYYMM'), '##')