Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Selecting a default date using Trigger function


Hi All

I would like the previous month by default to be selected in the list box of Projectmonth whenever I open a particular sheet. My ProjectMonth field is in the form of a text. So I created a Trigger by selecting the sheet. OnActivate Sheet> Actions> Select in Field. I have defined ProjectMonth in the 'Field' box. I defined the below expression in Search String box i.e. =if(monthname(Date#(ProjectMonth, 'MMM-YYYY')) = AddMonths(MonthName(Today(),0),-1),monthname(Date#(ProjectMonth, 'MMM-YYYY'))) but I am not getting the desired value of Nov 2015 when i click on the desired sheet. Can anybody please clarify as to what I am doing incorrectly here?

Thanks Sanjyot

2 Replies
marcus_sommer

Try it with = "=date(monthstart(today()-1), 'MMM') & '-' & year(monthstart(today()-1))"

- Marcus

Not applicable
Author

food for thought - I have encountered some issues with triggers in Ajax and have had to run the application with the IE plugin in order to get the triggers to work successfully and consistantly