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: 
lorenwood
Contributor III
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
Specialist II
Specialist II

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

View solution in original post

4 Replies
chematos
Specialist II
Specialist II

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
Luminary Alumni
Luminary Alumni

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
Contributor III
Contributor III
Author

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
Specialist II
Specialist II

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