Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

The use of variables to filter a date range

Hi there,

I'm new (ish) to Qlikview and have a question, which has been asked before and resolved, however it does not seem to work for me!!

I have a Qlikview report which I want to be able to filter on for a date range. The end user does not like the slider option and would just like to be able to input a from and to date and this should automatically filter the record set in a straight table or table box.

So, the method I've chosed is to create two variables; startdate & enddate.

I've created two calendar objects to populate the variables.

I have set up two variable trigger events onInput and onChange; The Action is to 'Select in Field" on column TRADE_DATE and the search string is

='>='&Date(STARTDATE)&'<='&Date(ENDDATE).

I have created a simple List Box which contains TRADE_DATE

Now, on the example I have downloaded, when inputting a date range I see in a Current Selections box <<date_column>> >=01/01/2010<=01/01/2011

which is what I want, however in my report nothing happens. Have I missed a step??

Here's the post I got the information from. http://community.qlik.com/message/125465#125465

Many thanks for your help.

Rob Walker.

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Rob,

Check the button "Apply Date Filter" I've just created in your same application to get the start and end date and apply that filter to the whole sheet. Please check the calendar objects, minum and maximum, where I've prefixed the expression Min() and Max() with the "=" sign.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

View solution in original post

14 Replies
SunilChauhan
Champion
Champion

here you have two  input variable

where user can enter their dates and

result will filter accordingly

Sunil Chauhan
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

    Have a look at the other example.

    Hope this helps.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi Sunil,

Thanks for the reply. It looks like this is run off a Macro. I would like to get the same effect without using a macro (as in the example in the hyperlink). It would appear that I'm missing a step even though I've set up the 2 variables, the calendar inputs for those variables and the trigger variable events.

Many thanks

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

     Did you try the example i gave you.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Still doesn't seem to link as I would like to my date field. I will add a sanitised version of my qvw.

Thanks.

Not applicable
Author

I've uploaded the qvw. What I had originally were 2 variables (not QV recommended naming conventions I know!!) which the two calendar selections populated. I then had variable trigger events onInput & onChange and an Action on Select on field. On the example qvw from that post, when you select values for the dates the Current Selections contain the necessary filter, however on my qvw, the event doesn't seem to trigger?

I've also added your calculation to the TRADE_DATE list box using the values from the variables, and again updating the calendar objects doesn't seem to do anything....??

Not applicable
Author

Hi Kaushik,

I've added a cut down version of my qvw to my post.

Many thanks.

SunilChauhan
Champion
Champion

hello rob

its not a macro

only i did added two inputbox and added two dates field

Input box provide the facility to enter .so you can enter your date range

from date in one and to date in other .

Sunil Chauhan
Not applicable
Author

Still doesn't seem to work on my qvw. I've attached it for your perusal. Are you able to see where I'm going wrong?

Many thanks