Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to add a Time dimension?

I want to add three list boxes with Year,Month and Day. Is there any in built functionality

5 Replies
Not applicable
Author

check this post http://www.quickqlearqool.nl/?p=160

example one should do the trick.. make sure you manually replaces al the 'qoutes' .. see last comments in the post!

Not applicable
Author

I don't exactly know what you mean, but if you already have a date value available you can create a List Box based on an expression:

=Year(Date)

prieper
Master II
Master II

Hi,

would suggest to review date/time-functions in the OL-Help, there are various useful functions available: you mentioned already Year, Month, Week and - seems to be more useful - Quartername, Monthname, Weekname are pretty useful in listboxes

HTH

Peter

Anonymous
Not applicable
Author

A typical example:


LET Start = floor(yearstart(addmonths((today()), -36)));
LET End = floor(num(yearend(addmonths((today()), 36))));
LET NumOfDays = End-Start+1;
Date_src:
LOAD
$(Start)+rowno()-1 as DateID
AUTOGENERATE NumOfDays;
Date:
LOAD
DateID,
date(DateID) as Date,
day(DateID) as Day,
week(DateID)as Week,
month(DateID) as Month,
dual(month(DateID) & '-' & right(year(DateID),2),
year(DateID) & num(month(DateID), '00')) as MonthYear,
year(DateID) as Year,
weekday(DateID) as Weekday,
if(weekday(DateID)>4, 0, applymap('HolidayMap',left(date(DateID),5),1)) as WorkDay
RESIDENT Date_src;
DROP TABLE Date_src;


Regards,
Michael

Not applicable
Author

Thanks a lot Michael!