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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trigger actual Month in Sheet

Hi, I have a QW application with listbox for "year" and "month" and I wonder if its possible to create a trigger

so that actual year and actual month is displaying every time a user accessing the sheet. Some sheet should have

no filter and I have been implementing that as a trigger. Not sure how to use values as triggers

/mikael

10 Replies
tresesco
MVP
MVP

Hi,

For this you have to make sheet trigger. Go to Sheet property ->trigger->OnActivateSheet->Add->Selection->Select In Field->OK

Now in the Field put your YEAR _field . In the "Search String" write: =Year(Today())

The same you can do for MONTH also.

Thanks and Regards,

tresesco

Not applicable
Author

Hi,

And if i have a MonthYear Field, how can do it for this?

Regards

Orlando

montubhardwaj
Specialist
Specialist

in the script you can create a MonthYear field and then you can trigger sheet with this new field as suggested by Tresesco.

Regards,

Sharma

Not applicable
Author

In your script with your full date...

MONTHNAME(YOUR_FULL_DATE) AS month_year,

Not applicable
Author

Thanls for your answer but, i've already do that, my question is how can i put in the trigger to get always the actual date?

montubhardwaj
Specialist
Specialist

Select the desired field in the trigger on Sheet (the one you want to have the Actual/Current date) and in the Search condition put Year(Today()) or Month(Today()) depending upon what you want as Selection.

Regards,

Sharma

Not applicable
Author

SHARMA:

IF I NEED BOTH OF THEM I CAN PUT LIKE THIS YEAR(TODAY()) & MONTH(TODAY())?

Not applicable
Author

Thank you for your answer / regards mikael

montubhardwaj
Specialist
Specialist

'Otherwise you can achieve this by using Macros.YOU CAB HAVE TWO VARIABLES CREATED LIKE :

Month_now=Month(now())

and Year_now=Year(now())

and then macro like this:

sub active:

activedocument.variables("Month_now")

activedocument.variables("Year_now")

end sub

(please check for actual syntax for macro)

after that trigger this macro for all the sheets where you want to have current month and years selected.

P.S this is just a hint and might help you out.

Cheers,

Sharma