Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Auto generate dates on Qlikview

Hey guys, I need to create a database with dates directly on Qlikview, from jan/1/2008 until today on Qlikview, and I need it to be created day by day, and month by month. How do I do that????

1 Solution

Accepted Solutions
yavoro
Partner - Contributor III
Partner - Contributor III

try this script:

Dates:

Load

  Date(Date,'YYYYMMDD') as DateId,

  Date,

  Date - MakeDate(Year(Date),01,01) + 1  AS DayInYear,

  Year(Date) AS Year,

  Month(Date) AS MonthName,

  Month(Date) & ' ' & Year(Date) AS MonthNameYear,

    Ceil(Month(Date)) as Month,

  Week(Date) AS WeekInYear,

  Day(Date) AS DayInMonth,

  WeekDay(Date) AS DayInWeek,

  QuarterName(Date) AS QuarterNameYear,

  SubField(QuarterName(Date),' ',1) AS QuarterName,

  'Q' & Ceil(Month(Date)/3) as Quarter;

Load

  AddMonths(today(),12) - recno() AS Date

Autogenerate (AddMonths(today(),12) - MakeDate(2012,01,01));

Y.A.

View solution in original post

1 Reply
yavoro
Partner - Contributor III
Partner - Contributor III

try this script:

Dates:

Load

  Date(Date,'YYYYMMDD') as DateId,

  Date,

  Date - MakeDate(Year(Date),01,01) + 1  AS DayInYear,

  Year(Date) AS Year,

  Month(Date) AS MonthName,

  Month(Date) & ' ' & Year(Date) AS MonthNameYear,

    Ceil(Month(Date)) as Month,

  Week(Date) AS WeekInYear,

  Day(Date) AS DayInMonth,

  WeekDay(Date) AS DayInWeek,

  QuarterName(Date) AS QuarterNameYear,

  SubField(QuarterName(Date),' ',1) AS QuarterName,

  'Q' & Ceil(Month(Date)/3) as Quarter;

Load

  AddMonths(today(),12) - recno() AS Date

Autogenerate (AddMonths(today(),12) - MakeDate(2012,01,01));

Y.A.