Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

lorenwood
New Contributor III

Using a Date to get a range of days

Hello, I want to know if it possible within the UI to get a range of days by selecting a date.

For example, I am looking at contracts with an End Date. The client I am working for wants to be able to enter a date in an input box and find all of the contracts that will expire between now and the specified date entered in the input box. I wanted to know if this can be done beyond the object level and be used as an assocation to the rest of the data.

Any suggestions would be appreicated!

Thanks

1 Solution

Accepted Solutions
chematos
Valued Contributor II

Re: Using a Date to get a range of days

Yes, it´s possible.

You can use the variable of the input box, for example if you call it vDate you could have something like this:

only({<End Date={'>=$(=Today()) <= $(vDate)'}>} Contract)

hope this helps

4 Replies
chematos
Valued Contributor II

Re: Using a Date to get a range of days

Yes, it´s possible.

You can use the variable of the input box, for example if you call it vDate you could have something like this:

only({<End Date={'>=$(=Today()) <= $(vDate)'}>} Contract)

hope this helps

matt_crowther
Valued Contributor

Re: Using a Date to get a range of days

Try something based around an if() like the one below:

=count(if(End_Date>=today() and End_Date<=$(v_Future_Date),Contract_Number))

The syntax isn't checked but the principal should work - it will count all contracts between today and the date in your variable 'v_Future_Date'.

Hope that helps,

Matt - Visual Analytics Ltd

Qlikview Design Blog: http://QVDesign.wordpress.com

@QlikviewBI

lorenwood
New Contributor III

Re: Using a Date to get a range of days

Thanks Jose I could see how this would work, my next question is can I use this script at the object level or is there a way to use this variable as an association to the data model?

chematos
Valued Contributor II

Re: Using a Date to get a range of days

You can use the variable in both of them, but  I don´t know how would you want to use it at script level, I would use only at the object level.

At script level you need to declare the variable and you could use the same variable at the object level, there is communication between them

Community Browser