Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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"
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"
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.
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.
Hi @Corfiz
It is possible but there are specific steps you need to take to do it:
=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
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
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?
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