Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
aboliogale
Contributor II
Contributor II

Selection of month range in trigger

Hi,

Could you please tell me how to apply on opening trigger for the range of  month year combination field?

  • I have month year field (named as MY) generated from date using MonthName()
  •  I want to select last 1 year data from Max month - 3
  • Ex: Max month is June 2020, I want to select Max month - 3 i.e.  (June 2020 - 3 = March 2020), of previous 12 months.
  • From March 2020 till March 2019, months should get selected in the MY.

Tried by creating variable as :

vStart =MonthName(AddMonths(Max(MY), -15))

vEnd =MonthName(AddMonths(Max(MY), -3))

In triggers,

  • Action: Select in field
  • Field: MY
  • Search string:  ='>='&vStart &'<='&vEnd

But it is not working.

Appreciate your quick response. Thanks in advanced 🙂 

Labels (4)
1 Reply
edwin
Master II
Master II

it should be in the format 

(XXXXX|XXXXXX|XXXXXX)  in your case: ("Mar 2019"|"April 2019"|"May 2019")...

use the following in your action search string:
='("' & concat(distinct {<dt={">=$(vStart)<=$(vEnd)"}>}mnt,'"|"') & '")'

attached uses 12/1/2020 as the max date.