cancel
Showing results for
Did you mean:
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).

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

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

Labels (1)
• ### General Question

1 Solution

Accepted Solutions
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),'|')&')'

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

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.
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?

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.
Contributor III
Author

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

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),'|')&')'

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
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?
Thank you

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.