
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Always one selected value WITH VARIABLE
Hi,
I need to set a date field to "always one selected value", so that only one single value will be selected at all times. I've seen the excellent QlikSense help video on that subject (https://help.qlik.com/en-US/sense/February2024/Subsystems/Hub/Content/Sense_Hub/DataSource/select-si...), so I know how that is done.
My problem is that I need to alwas set it to the "current date" on opening. The current date is written in a variable, or I could use today() - but neither of those work with the bookmark I'd have to use according to the video.
Does anyone have any ideas? The only one I come up with is resorting the calendar-table in some weird way, so that the current date would be the first value in the table and so the automatic selection - but if there was an easier way to set it to a variable value, I'd much prefer it.*
Thanks everyone!
*Edit: I'm not even sure that would work, because "the first value in the dimension" wouldn't necessarily mean "the first value by loading order", it could also be "the first value according to our sorting order, which is numeric for a date field"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you tried using an action on the sheet level to either "apply a bookmark" or "Select values in a field". You could either use the bookmark that is holding your current day selection or just add your variable to the value section in "Select values in a field"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, thanks for the reply! The problem with that is that I don't think it would work with the "Always one selected value" option - you set that on the field level in the field properties - and the default selected value when you open the app is apparently always the first one in the dimension.
Also, if I apply that action to every sheet, the users will go nuts, because their date selection will be reset whenever they switch sheets.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-4, Another option would be to create a new field in your script that would either hold the current date or a flag field that has a 1 applied to the current date. Use that new field as your "Always one selected value" option.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Corfiz
It is possible but there are specific steps you need to take to do it:
- remove "always one selected value" from your field and clear selection
- create default bookmark using "advanced search" option - note that for this to work you will need to use set analysis to ensure it will still work when "always one selected is still" applied"f, or example:
-
=Only({1}Year)=Max(Total {1}Year) Make sure bookmark is set when there is more than 1 value available (always one selected value disabled). Adjust the formula to your fields and search criteria
-
- Test
- RE-apply always one selected value and test again
The point i highlighted in RED is critical - if you leave "always one selected value" on when doing it then bookmark does not store search formula but single field value which is not going to work
cheers

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Lech,
thank you so much for your help, and sorry for asking again, but I can't edit the expression in my bookmark, only the name. Is there a trick to it?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Corfiz
Well - you dont need to edit expression in bookmark. You need to create one from scratch using advanced search option to apply default filter. Here you have video about the process:
https://youtu.be/tFyqOigqnUw?si=TnYz7funH5Bz9O1U
cheers
