Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have seen that this question has been asked before but the link to the solution no longer works.
I have a field which contains the last 5 dates. If a bookmark is created it saves the date selected. When the bookmark is applied at a later date no value is selected in the date field as the date no longer exists when the bookmark was created)
I am trying to create a trigger to select max date but this does not work.
Any ideas how to do this?
I'd revisit the fundamentals - why do you have a field that contains the last 5 days? Could you replace it with a pre-calculated flag that marks the last 5 days in the calendar? Then, when the bookmark doesn't need to save the specific dates...
cheers,
Oleg Troyansky
www.masterssummit.com - take your QlikView skills to the next level!
To select max date, use select in field action. If the field is Date, the search string is
=max(Date)
or
=max({1} Date) - in case you want to select absolute last date ignoring selections.
Hi Michael
That is exactly what I am trying to do. But when I apply the bookmark the trigger on the date field is not executed.
Not quite clear... Probably you should have OnOpen trigger rather than a bookmark.
The trigger works fine on open.
What I am trying to achieve is if the user has been using the report and then decides to apply a previously saved bookmark.
If the date does not exist then the max date should be selected.
There is no trigger "OnBookmark". You can try this:
Include a dummy field into the bookmark, a data island with two values, e.g. 0 or 1. Set it to 0 on open, and use value 1 in the bookmark. Use this field as a trigger. The trigger is to be fired on change of this field, and if the value is 1, check if bookmark selected a date (there is a challenge here, how to define "date is selected by the bookmark") - if not, select the last date.
Hope it gives a direction...