Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
MZambo89
Contributor III
Contributor III

Pre Select date range in Action Sheet

Hi there,
I would like to add an action to one of the sheets of the app I created: I want to preselect a range of dates which goes between Today -10 and Today + 10 (so the next and the last 10 days).
At the moment I managed only adding one (I do not know how I can add the rest of them).

MZambo89_0-1669654347882.png

I wanted to achieve this either by an action (possibly) or otherwise by using the left "date picker".

MZambo89_1-1669654460122.png

At the moment that is set so the user can only see the next and last 10 days otherwise that would go back a couple of years and would be annoying for the user

MZambo89_2-1669654560513.png

Thank you in advance

 

Labels (1)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Try this

under Action:  Choose Toggle Field Selection

Fx :    

'('&concat({<Datefield={">=$(=Date(Today()-10))<=$(=Date(Today()+10))"}>}distinct chr(34)&Datefield&chr(34),'|')&')'

 

vinieme12_0-1669714150787.png

 

 

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

7 Replies
vinieme12
Champion III
Champion III

Add sheet action as below

Action : Select values in field

Field : Yourdatefield

Fx     =Yourdatefield>= Max(total Yourdatefield) - 10    (with equal sign)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
MZambo89
Contributor III
Contributor III
Author

Hi There. I also have future days in my date field so won't the formula you suggested show only the last 10 but not the next? 

vinieme12
Champion III
Champion III

modify as below

=Yourdatefield>= Date(Today()-10)  AND Yourdatefield<= Date(Today()+10)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
MZambo89
Contributor III
Contributor III
Author

That doesn't work, unfortunately.
It just shows all dates. 

MZambo89_0-1669713328843.png

 

 

vinieme12
Champion III
Champion III

Try this

under Action:  Choose Toggle Field Selection

Fx :    

'('&concat({<Datefield={">=$(=Date(Today()-10))<=$(=Date(Today()+10))"}>}distinct chr(34)&Datefield&chr(34),'|')&')'

 

vinieme12_0-1669714150787.png

 

 

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
MZambo89
Contributor III
Contributor III
Author

Super!!! This worked!!!
Can I ask how did you achieve that? Apologies but I am not familiar with this concat and chr 34 format you used? 
It would be great to know how I can get more information/knowledge about this. 
Thank you

vinieme12
Champion III
Champion III

we are doing a compound search basically creating a list of dates that need to be selected

instead of comparing > < dates

 

refer below

https://community.qlik.com/t5/Design/The-Search-String/ba-p/1470548

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.