Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
johanlind
Contributor II
Contributor II

Macro for selecting year

I want to write a macro for selecting this year and previous year, when the data is reloaded.

How do I write the macro ?

1 Reply
gandalfgray
Specialist II
Specialist II

I would create an OnPostReload Trigger with a Selection Action, like this:

To get it dynamic create a variable CurrentYear which you sets to the current year in the load script,

and change the Search String shown above to this instead:

='>=' & ($(CurrentYear)-1) & ' <=' & $(CurrentYear)