Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for
Did you mean:
Creator

## Master Calendar With Hour

hi all

i try to create a master calendar with Hour

LET vMinDate = num(Timestamp(Timestamp#('05/05/2015 05:05:05','MM/DD/YYYY hh:mm:ss')));

LET vMaxDate = num(Timestamp(Timestamp#('05/06/2015 15:05:05','MM/DD/YYYY hh:mm:ss')));

LET vDays = vMaxDate - vMinDate ;

Calendar:

Date(MonthName(KeyDate),'MMM/YYYY') as MonthYear,

Month(KeyDate) as Month,

Day(KeyDate) as Day,

Date(Floor(Date(KeyDate,'MM/DD/YYYY')),'MM/DD/YYYY') as Date,

Hour(KeyDate) AS Hour,

Timestamp(Floor(KeyDate, 1/24),'MM/DD/YYYY HH') as KeyDate;

Timestamp(\$(vMinDate) + (RecNo()-1)/24) as KeyDate

AUTOGENERATE 24 * \$(vDays);

Max date Max hour is 15 but Hour 15 is not associated with Date what i did wrong?

1 Solution

Accepted Solutions
MVP

I think you were adding one less hour

LET vMinDate = num(Timestamp(Timestamp#('05/05/2015 05:05:05','MM/DD/YYYY hh:mm:ss')));

LET vMaxDate = num(Timestamp(Timestamp#('05/06/2015 15:05:05','MM/DD/YYYY hh:mm:ss')));

LET vDays = vMaxDate - vMinDate ;

Calendar:

Date(MonthName(KeyDate),'MMM/YYYY') as MonthYear,

Month(KeyDate) as Month,

Day(KeyDate) as Day,

Date(Floor(Date(KeyDate,'MM/DD/YYYY')),'MM/DD/YYYY') as Date,

Hour(KeyDate) AS Hour,

Timestamp(Floor(KeyDate, 1/24),'MM/DD/YYYY HH') as KeyDate;

Timestamp(\$(vMinDate) + (RecNo()-1)/24) as KeyDate

AUTOGENERATE 24 * \$(vDays) + 1;

3 Replies
MVP

Can you attach your qvw file?

Creator
Author

PFA..

MVP

I think you were adding one less hour

LET vMinDate = num(Timestamp(Timestamp#('05/05/2015 05:05:05','MM/DD/YYYY hh:mm:ss')));

LET vMaxDate = num(Timestamp(Timestamp#('05/06/2015 15:05:05','MM/DD/YYYY hh:mm:ss')));

LET vDays = vMaxDate - vMinDate ;

Calendar:

Date(MonthName(KeyDate),'MMM/YYYY') as MonthYear,

Month(KeyDate) as Month,

Day(KeyDate) as Day,

Date(Floor(Date(KeyDate,'MM/DD/YYYY')),'MM/DD/YYYY') as Date,

Hour(KeyDate) AS Hour,

Timestamp(Floor(KeyDate, 1/24),'MM/DD/YYYY HH') as KeyDate;

Timestamp(\$(vMinDate) + (RecNo()-1)/24) as KeyDate

AUTOGENERATE 24 * \$(vDays) + 1;

Community Browser