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

Button to select multiple dynamic values

Hi everyone,

I'm attempting to create a button that can select Today and Yesterday simultaneously. For my purposes, hard-coded buttons are very useful to the users of the dashboard, because most of the time in my industry, the only data required is from today, yesterday, and a combination of the two.

Currently I have a button to select Today, which uses the date field from my database with the value  =Today().  I also have a button which selects Yesterday, using the value  = (Date(Today()-1)).

The problem occurs when I try to combine the two. I've tried seperating them with pipes as is recommended in solutions to similar problems, in addition to many combinations of functions, to no avail. I've also tried bookmarks, but bookmarks only save the date from when the selection was made. Alternatives to the buttons such as filters aren't the solution I'm looking for; it has to select Today and Yesterday with a single click. I also can't provide much more information for data protection reasons.

Thanks,

Jordan

1 Solution

Accepted Solutions
GaryGiles
Specialist
Specialist

Try this for the value expression in the botton control:

=Today()&';'&(Today()-1)

The trick is separating the values with ';'

View solution in original post

2 Replies
GaryGiles
Specialist
Specialist

Try this for the value expression in the botton control:

=Today()&';'&(Today()-1)

The trick is separating the values with ';'

jordan1
Contributor II
Contributor II
Author

Semicolon seems to have done the trick! Thanks for the advice and the quick response.

It only needed a little tweak and it worked immediately, for anyone else who might encounter this problem, the following expression worked for me

=Today()&';'& (Date(Today()-1))