Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating button to select date interval

Hi,

I have a field with dates called MyDate. I want to create a button that will allow the user to click and select the last 7 days.

I have tried the Select in Field option, however I have had no luck with Interval, or even just subtracting the dates.

Help is appreciated!

5 Replies
whiteline
Master II
Master II

Hi.

You can calculate the search string like this:

= '>=' & Max(MyDate)-7

or 

= '>=' & Max({1} MyDate)-7 to discard the user selections.

Not applicable
Author

Hi,

If i put that in the search string, it still does not make the selection. In the Current Selections section, it doesn't show a selection. However, if I get rid of the "- 7", it shows the selection. I've tried wrapping it around a DATE(), but that doesn't seem to help either.

whiteline
Master II
Master II

Hi.

Try to make it work with a static string, for example'>=2013/09/1'. Then you can write an expression with appropriate date format.

What is the result of =Max(MyDate) expression if you put it in a TextBox ?

Not applicable
Author

The result of the =Max(MyDate) is 9/24/2013 9:00:11 PM

So the question remains, how do i subtract 7 days from this?

whiteline
Master II
Master II

It's dual both text and numeric.

I think the problem is with text format.

Does string '>=09/15/2013' works as a search string ?

If so, try

= '>=' & Date(Max(MyDate)-7)