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

Announcements
Mastering Change Data Capture: Read Now
cancel
Showing results for 
Search instead for 
Did you mean: 
tchovanec
Creator II
Creator II

Create a Calendar with Dates and Times by hour

I am trying to create a calendar that will give the following output

Start                  End

12:45 AM           1:45 AM

1:45 AM            2:45 AM

2:45 AM            3:45 AM

and so on......

I am able to get the following.

Start                  End

12:00 AM           1:00 AM

1:00M               200M

2:00M               3:0AM

To get this I am using the following code.

 

Load
TIMESTAMP($(vMinDate) + ((RecNo()-1)/24) + (IterNo() - 1)) as Start
AutoGenerate 24
While Num($(vMinDate) + IterNo() - 1) <= Num($(vMaxDate));



1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try adding 45 minutes, 3/4 * 1 /24 = 3/96:

Load
TIMESTAMP($(vMinDate) + 3/96 + ((RecNo()-1)/24) + (IterNo() - 1)) as Start
AutoGenerate 24
While Num($(vMinDate) + 3/96 + IterNo() - 1) <= Num($(vMaxDate)) + 3/96 ;


talk is cheap, supply exceeds demand

View solution in original post

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try adding 45 minutes, 3/4 * 1 /24 = 3/96:

Load
TIMESTAMP($(vMinDate) + 3/96 + ((RecNo()-1)/24) + (IterNo() - 1)) as Start
AutoGenerate 24
While Num($(vMinDate) + 3/96 + IterNo() - 1) <= Num($(vMaxDate)) + 3/96 ;


talk is cheap, supply exceeds demand