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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Is there a simple formula to create a dynamic calendar?

Where week 1 = 11/9 to 11/15, week 2 = 11/16 to 11/22, week 3 = 11/23 to 11/29 and so forth... and the calendar will update automatically based on today's date (ie in 7 days week 1 = 11/16 to 11/22)???

2 Replies
SergeyMak
Partner Ambassador
Partner Ambassador

Hi,

something like this
Calendar:
LOAD Date,
'Week ' & Week AS Week;
LOAD
Date(Num(Today())+RecNo()) AS Date,
FLOOR(RecNo()/7)+1 AS Week

autogenerate Num('01/01/2015')- Num(Today())-1
  ;

Regards,

Sergey

Regards,
Sergey
Anonymous
Not applicable
Author

Hey,

You may use this as well.

Calendar:

Load

Date(TempDate) As Date,

Year(TempDate) As Year,

Year(YearStart(TempDate, 0, 4)) As FY,

Month(TempDate) As Month,

Dual(

Text(Month(TempDate)),

Num(Month(MonthStart(TempDate, -3)))

) As Period,

Date(MonthStart(TempDate), 'YYYY-MM') as YearMonth,

Dual(

Year(YearStart(TempDate, 0, 4)) & '-'

& Num(Month(MonthStart(TempDate, -3)), '00'),

MonthStart(TempDate)

) As FYPeriod

;

Load

RecNo()-1+Floor(MakeDate(2012)) As TempDate

AutoGenerate(730);



Regards,

Chinna