Question

I have a button that when it is clicked I want it to select the last 14 days. This means that if today's date is 2014-03-12, I want it to select all dates between 2013-02-26 and 2014-03-12.

I have a time_table with the fields KEY_timestamp (yyyy-mm-dd), year, month, day.

In my button I have an action Select in Field, with the field KEY_timestamp and I have a Search String which looks like

=if(
    now() - 14 < KEY_timestamp,
    KEY_timestamp
)

Now, to tell you the truth I have no idea how to go about this, and my experience with Qlikview is limited at best... I hope somebody can point me in the right direction. I tried Googling this but I've been unsuccessful so far.

Was it helpful?

Solution

In the search string type only this line:

='>' & date(now()-14) &  '<= ' & date(now())

If it didn't work properly, add this line in your script:

date(KEY_timestamp) as KEY_timestamp_formatted

and then replace your select in field with the new column

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top