Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
Talk to Experts Tuesday, Live Q&A, September 22: Moving from QlikView to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
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.

Highlighted
Not applicable

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.

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

Highlighted
Not applicable

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?

Highlighted
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)