Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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

‌Hi Ashok,

Try adding a "Select Possible" to the end of your triggers. Sometimes that makes the selections appear as desired.

-Josh

Qlik

stevelord
Specialist
Specialist

Calendar object never let anyone select more than one day.  I quit using it and just use the list boxes, sort state ascending, numeric value descending.  End users requested I make the listboxes long (maybe 6 inches) to aid in selecting longer date ranges.  Would be nice if Qlik fixed the calendar object since it is a more efficient use of space if it can be used to select more than one day.   (I could use variable input boxes for date start/end, but the date formatting has to be precisely right, and input boxes were a tad finicky, so end users had an easier time just selecting 50 days on a listbox.)  At the least, you can do date(floor(date)) for your date listbox to only show whole days.

Also a year-month listbox and certainly a year listbox to help with longer date ranges provided they include whole months or years.

Not applicable

Thanks Josh. This is a really helpful video.

I have two questions. Is that possible that the Slider/Calander Object not linked to a date field (such as OrderDate in the example)? Can I have a general calendar and when I choose the StartDate and EndDate, the records in my other objects would change? If I can do it, how should I do?

Another question is, I saw some posts shows that we need to create a master calendar in Script as below. But from your example, seems like we don't really write those code in script. Am I understand correct? Or the script and the example you showed in the video are totally different things?

LET VarMinDate = Num(Peek('OrderDate',0,'OrdersQuery'));

LET VarMaxDate = num(peek('OrderDate', -1, 'OrdersQuery'));

LET VarToday = num(Today());

TempCalendar:

LOAD

$(VarMinDate) +  RowNo() -1 as DateNum,

Date($(VarMinDate) +  RowNo()-1 ) as TempDate

AutoGenerate

$(VarMaxDate) - $(VarMinDate);

MasterCalendar:

LOAD

TempDate as OrderDate,

Week(TempDate) as Week,

Year (TempDate) as Year,

Month(TempDate) as Month,

Day(TempDate) as Day,

WeekDay(TempDate) as WeekDay

Resident TempCalendar;

Thanks,

Becky

Not applicable

Hi dear,

I have a field "YearMonth" as value = "2016-06" and I need to apply same functionality as is shown in this video, but does not work in my lab. When I set StartDate = "2016-04" dont apply in filters: in List box, the table and current sellecion filters.

I'm wondering if this functionality works in dates with this format YYYY-MM?

Thanks,

Not applicable

Very important point, one must convert the field to Date every time or else at some point it you may stuck. Thanks a lot Josh, very helpful post

Not applicable

Thanks Josh. This is a really helpful video.

I tried to follow your step to develop a date selection app but I cannot make the end date work.

Please see attached sample. The End Date can not select the date.

Please help.

Thank you very much in advance!

Josh_Good
Employee
Employee
Author

Hi Zili,

I took a quick look at your app. For me, End Date is making selections however I'm not getting the expected selections.  It appears to be selecting up to the day before the date selected.  I believe this is because your dates are not actually date-time.  When you load your data you need to use the floor function.  So it will be something like this:

date(floor(BAVIM_Date_Mod), 'MM/DD/YYYY') as BAVIM_Date_Mod

-Josh

Qlik

Not applicable

Hello Josh,

Your solution rocks. It works very well.

Thank you very much! You are awesome!

tahreen371
Contributor III
Contributor III

Very helpful, ThanksSmiley Happy

Michael-BSCU
Contributor II
Contributor II

Hello Josh,

 

Thank you for your prompt response.

Much appreciated.