Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Set Filters to a default Date Range

Hello,

I have a slider/Calendar Object on a dashboard. I would like this, by default, to show a specific date range. From my reading, it says i can possibly build a macros to do this, however I do not have any experience in building a macro in Qlikview. Is there an easier way to do this right in the slider/calendar properties?

1 Solution

Accepted Solutions

Re: Set Filters to a default Date Range

How about this:

='>=' & Date(WeekStart(Max(Date))) & '<=' & Date(WeekEnd(Max(Date)))

11 Replies

Re: Set Filters to a default Date Range

You can use a on-open trigger to do this may be.

Not applicable

Re: Set Filters to a default Date Range

Thank you Sunny,

Are you able to provide me an example or point me to instructions on how to do this?

galax_allu
Valued Contributor

Re: Set Filters to a default Date Range

Hi

Included the video in powerpoint (2013) and example (qvw) as well

Not applicable

Re: Set Filters to a default Date Range

Thank you,

I see you have two calendar objects to show a date range, I want to show last week's date range on a slider by default. Is there a way I can do this?

boorgura
Valued Contributor

Re: Set Filters to a default Date Range

on_open_trigger.JPGYou can set the default range in the field as an "on open trigger".

document properties --> triggers tab --> Add an action for OnOpen Trigger

in the action --> select in Field --> specify the field name and appropriate selection criteria.

Not applicable

Re: Set Filters to a default Date Range

Thank you,

So the set up of my dashboard is as follows:

I have three tabs, all displaying data from different data sources. On each of the tabs, I need to show the date range of the week prior. Each data source has a different date field so I believe  I will need to create three different triggers so each of the tabs opens up with the correct date range. Would that work?

boorgura
Valued Contributor

Re: Set Filters to a default Date Range

Instead of document trigger - you will have to do a sheet trigger.

Sheet Properties --> Triggers Tab

Not applicable

Re: Set Filters to a default Date Range

Thank you!

So my

Field under the add Action is 'Date'

And my Search String is:

=('>='& Date(WeekStart(Max(Date))) & '<=' & Date(WeekEnd(Max(Date))))


However this does not seem to work. I am not getting an error, however the filter is not automatically applied to the slider object.

boorgura
Valued Contributor

Re: Set Filters to a default Date Range

Try not using the &

Usually search string would be like this:

>=1/1/2016 <=2/28/2016

Community Browser