Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
ksleiniwe
Contributor
Contributor

Simple data range question

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)
  • SaaS

1 Reply
edwin
Master II
Master II

if the question is to generate date field values even if you dont have those date values in a different table, you can use iterno:

//generate dates based on another date (this one is 90 days past)
load date(today()-iterno()+1) as date
where date(today()-iterno()+1) >= today()-90;
load 1 AutoGenerate(1);

//or based on number of days
load date(today()-iterno()+1) as date
where iterno()<=90;
load 1 AutoGenerate(1);

 

hope that helps