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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
matirdamb
Contributor
Contributor

Simple data range question

Hi guys, i'm stucking ni this simple situation where i need ta have bars from a date range (2014-now) but not all date have data in them, how do i generate a local autogenareted table with a date range? in Oracle i would do someting like this: SELECT (to_date(sysdate,'DD-MM-YYYY') - level + 1) AS day FROM dual CONNECT BY LEVEL <= (to_date(sysdate,'DD-MM-YYYY') - to_date('01-01-2014','DD-MM-YYYY') + 1);

Labels (1)
1 Reply
justISO
Specialist
Specialist

Hi, you can try something like this:

LET vCalendarStart = Date('2014-01-01');
LET vCalendarEnd = Date(today());
LET vCalendarLength = Num(Date#(vCalendarEnd)) - Num(Date#(vCalendarStart)) + 1;

LOAD
Date($(#vCalendarStart) + RecNo()-1) AS Date
AutoGenerate $(#vCalendarLength);