Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Josh_Good
Employee
Employee

Selecting Arbitrary Date Ranges

Learn how to make arbitrary date range selections using a from and to date selection.

http://www.youtube.com/watch?v=UTDyO68BYL8

39 Replies
Josh_Good
Employee
Employee
Author

Looks like for whatever reason your End Date is coming back in a number format vs date format. Try forcing the search string to come back in the date format. So something like:
='>=' & Date(vStartDate) & '<=' & Date(vEndDate)

I'm writing this on my phone so the syntax might be a bit off - sorry.

Sent from my Commodore 64

Not applicable

Just added the Date() for the End Date, and it works. Strange, isn't it?

Regards.

Damian.

Not applicable

Dear Josh,

Thanks for the great explaination.

However i am getting an issue in dates.qvw.

When i am opening from server (as a developer) the vBeiguDatums variable works correctly.

But when i am opening as a user from the IIS,i am not able to select the maxdate in calendar object.

Suppose the max date is 1/12/2014,when i am selecting 1/12/2014 in the calendar object it is not letting me select,instead 1/11/2014 is getting selected.

Is this a bug ?

Can you please help me.

Regards,

Rohan

Josh_Good
Employee
Employee
Author

Hi Rohan,

There are may factors that could be at play here depending on your specific qvw and the data in it.  There could be an error in the setup that is causing the wrong date to be selected or the date you are trying to select on (1/12/2014) doesn't exist in the data so QlikView is picking a the closest date less than your selection. 

To fully help you, I would need to see the QVW.  Would you be able to post it or so a version with scrambled data?

-Josh

Qlik

Not applicable

Dear Josh,

Thanks for the reply.

However the issue was with the Qlikview setup (server version).

I had qlikview sr9 on my development server whereas on production,it was SR8.

Once upgraded to SR9,the issue no longer exists

One more question regarding the calendar object though,is there a way to set a blank value as defualt in calendar object ?

When a user opens the qlikview report,the calendar object should be blank.

Regards,

Rohan

Josh_Good
Employee
Employee
Author

Hi Rohan,

You can set the document to remove the selections on the calendar upon open.  Look under Setting->Document Properties -> Tiggers.  Select "OnOpen" and use the "Select in Field" action.  By setting the Search String to blank, any selection will be cleared.   You may also need to add action to set the variable to blank as well.

-Josh

Qlik

Not applicable

Hi Josh

I had already tried this way,but the issue is qlikview recovers sessions,so

if a user does some selection in the calendar and then opens the app again

it starts from where he left,which is not what I want.

I always want the default value in calendar object to be blank.

Is there a way to disable session recovery for certain apps and keeping it

on for the other apps ??

Regards,

Rohan

Josh_Good
Employee
Employee
Author

Hi Rohan,

You can disable Session Recovery in the QMC under System-> Setup ->QlikView Servers ->Documents.  Note this is a global setting so it will effect all documents and all users in your enviornment.

-Josh

Qlik

fashid
Specialist
Specialist

Hi,

I have been struggling to get my date range selections working but i dont understand where i am failing .

If any body could help me with my sample app or a hint where im doing it wrong . !

I would grreatly appreciate it.

Regards,

Nadeem

Josh_Good
Employee
Employee
Author

Hi,

It looks like your expressions are returning the numeric value foe the dates the trigger is not able to select on the CalendarDate field.  In other words your expression:

='>= $(vstartdate)<=$(venddate)'

Returns this:

>= 42047<=42039

Use this expression:

='>= $(=Date(vstartdate))<=$(=Date(venddate))'

To Return This:

>= 2/12/2015<=2/4/2015

Hope this helps.

-Josh

Qlik