Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have to create a time dimention and I need to get the next structure:
Date| Year | Month | Day
And I need it to be since '01/01/2012' up to now.
I wanna know if exists some CURSOR statement that I can use in QlikView or maybe some DO-WHILE statement that adds one day to the date up to now and stores them in a qvd?
Hope your help!!
thanks
load
date,
year(date) as year,
Month(date) as month,
Day(date) as day;
load
date(Today()-RecNo()) as date
AutoGenerate (Today()-MakeDate(2012))
Hi Dario
this should be very good starting point:
http://community.qlik.com/blogs/qlikviewdesignblog/2012/10/16/the-master-calendar
regards
Darek
Do-While statement exists and a so called Autogenerate function will create a row for each loop in your table thus populating all necessary dates. Have a look at the QlikView Reference Manual.
Alternatively, this topic is also covered when creating a "Master Calendar".. search the forums for that keyword and you should find plenty of code example & information.
Thanks you so Much!!
Here is one more: http://community.qlik.com/docs/DOC-1310
Little Change on Clever's Script
load
date,
year(date) as year,
Month(date) as month,
Day(date) as day;
load
date(Today()-RecNo()+1) as date
AutoGenerate (Today()-MakeDate(2012)+1)