Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
alan_grn
Creator II
Creator II

Bookmarks and events - field selections

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?

6 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

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!

Anonymous
Not applicable

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.

alan_grn
Creator II
Creator II
Author

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.

Anonymous
Not applicable

Not quite clear...  Probably you should have OnOpen trigger rather than a bookmark.

alan_grn
Creator II
Creator II
Author

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.

Anonymous
Not applicable

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...