Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
s_herrera_pugli
Partner - Contributor
Partner - Contributor

OnOpen trigger: select max date from field

Hi everybody!

I want that everytime I open my dashboard, the more recent date is selected. The field i want this date is selected is named '-MonthYearMC', the format of the date of this field is 'MMM YY'.

I try in document properties>triggers>OnOpen>Select in field. but i have no luck .

I'll attach the script of the master calendar where my field is created.

Hope you could help me, thanks in advance.

PS: Have in mind that the date is always updating with more recent data.

 

Labels (8)
2 Replies
Brett_Bleess
Former Employee
Former Employee

Sofia, I need a little more information here in order to try to figure out if there is something we can do here.  I did want to point out to you that the OnOpen trigger is an unsupported trigger in the Ajax Client, this is documented in the following Help link:

https://help.qlik.com/en-US/qlikview/November2018/Subsystems/Client/Content/QV_QlikView/Document_Pro...

Just off the top of my head, I am thinking the better way to go at this may be to set a variable in the script and then use the variable to set the date etc...  My post will kick this back up in the list, so someone else may have something better, but I think that is going to potentially be the better way to go here, but I do not have an example for you.  If you have not searched the prior posts, you may want to do that, as I am pretty sure there are other posts out there along these lines too.  I would do it for you, but you know your use case better than do I, so I will let you have a look to see what you can find, and if you do find something but have further questions, just post that link back here and pose your question and hopefully one of can try to help you further.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
johnca
Specialist
Specialist

In as much as your field is text will do that:

Month(TempDate) &' '& Right((Year(TempDate)),2) AS[-MonthYearMC]

I would suggest instead creating the field in this manner:

Date(Floor(TempDate),'MMM YY') as [-MonthYearMC]

This will retain a numerical value and should fix your issue.

V/r,

John