Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
coddra_6
Contributor III
Contributor III

Time Dimention

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

6 Replies
Clever_Anjos
Employee
Employee

load

    date,

    year(date) as year,

    Month(date) as month,

    Day(date) as day;

load

    date(Today()-RecNo()) as date

AutoGenerate (Today()-MakeDate(2012))

Not applicable

Hi Dario

this should be very good starting point:

http://community.qlik.com/blogs/qlikviewdesignblog/2012/10/16/the-master-calendar

regards

Darek

simondachstr
Luminary Alumni
Luminary Alumni

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.

coddra_6
Contributor III
Contributor III
Author

Thanks you so Much!!

Anonymous
Not applicable

MK_QSL
MVP
MVP

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)