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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trigger on date functions.

I have expense Month-Year as below.I want to add a trigger to default to the rolling months period.

When I land on a page the trigger should default the Month-Yr from Aug - 2017 to June - 2018.How can I do that ?

Month-Year.GIF

Thanks much.

Labels (1)
5 Replies
sunny_talwar
MVP
MVP

I guess add a sheet level trigger like this:

='>=' & Date(MakeDate(2017, 8, 1), 'MMM-YYYY') & '<=' & Date(MakeDate(2018, 6, 1), 'MMM-YYYY')

This is assuming that Expense Month-Year is created like this in the script:

Date(MonthStart(DateField), 'MMM-YYYY') as [Expense Month-Year]

Not applicable
Author

yup...this is how I have the Month-year created but if I use (2017,8,1) every month I have to manually change it every month right ? Is there any way I can automate that ?

sunny_talwar
MVP
MVP

What is the logic for choosing August 1st 2017 and June 1st 2018?

maxgro
MVP
MVP

change the bold as your requirement

='>=' & Date(AddMonths(Today(),0), 'MMM-YYYY') & '<=' & Date(AddMonths(Today(),11), 'MMM-YYYY')

sunny_talwar
MVP
MVP

But maxgro‌ today is 2016, I think with this logic, he might need this:

='>=' & Date(AddMonths(Today(), 12), 'MMM-YYYY') & '<=' & Date(AddMonths(Today(), 23), 'MMM-YYYY')