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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Bookmarks

I need to create a bookmark that automatically select the most recent 'date'

For example, I will have certain selections (i.e region, state, product, etc) that will be set  in a bookmark but there is a new monday date each week. I want the bookmark to automatically select the most recent 'date' available for the certain selections that are selected in the bookmark.

Does anyone know how to do this?

9 Replies
simondachstr
Specialist III
Specialist III

Try setting a variable with the Bookmark and use a Variable Event Trigger to select the latest (max()) date available.

A more elegant solution would be to have a flag loaded in the script indicating if the date is the most recent. Then make sure that the bookmark selects that flag.

Not applicable
Author

How would you do the more elegant solution?

Not applicable
Author

As Martin noted, create a new field in your load script, let's say, MaxDateFlag, which would contain a 1 where your date field is the max date in your dataset. All other MaxDateFlag values would be 0. Then using a listbox for the MaxDateFlag field, select the 1 and bookmark it with your other selections. This way 1 always corresponds to the max date in your dataset.

For example:

Date          MaxDateFlag

08/11/14          1

08/10/14          0

08/09/14          0

Not applicable
Author

Could you expand on this please? How do you create the new field in your script?

Do you just write "1 as MaxDateFlag"

Not applicable
Author

You have many options here. My example above would be a scenario where you pull data from a database and create a new field, then apply logic to your date field to assign the 1 to the max date in your record set.

Another simple option would be to create a second load with just Date and MaxDateFlag which would only include on record (8/11/14 with the 1).  This load would join to your other records on Date and assign all 8/11/14 dates with a 1.

Hope this helps!

Not applicable
Author

Please see attachments.

I have two excel files, 1 old and 1 new for now but every week, there will be an addition of 1 new week to the same file that is uploaded. I want to create a bookmark that automatically selects the most recent week.

I seem to have trouble doing this, can someone help using the app?

Not applicable
Author

My previous suggestion will work. Just add a new column to your spreadsheet and flag the dates for the 'new' week. Use the new field within your bookmark so anytime new dates are added that have the flag for the new week it will carry through to the bookmark that already contains the selection for that flag.

Not applicable
Author

This is just an example. My actual source will be from an oracle database in which I cannot add a new column.

Not applicable
Author

Ok. Within the load you could still flag the max week. This could be done in the SQL or the preceding load. If you really just need a way to select the max week in the app, and don't have to use a bookmark, you could always just use a button and add logic to select the respective period. Like I mentioned before you have many options, which is a good thing! Good luck!