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: 
Anonymous
Not applicable

Time Dimensions on Load

I need to load 2 time periods as Dimensions from the TIME Dimension-

"MarketHours"

(=>08:00:00 and <=16:00:00) as MH

"AfterMarketHours"

(=>16:00:01 and <=23:59:59) as NMH

How would I do this in the load script?

Thanks in advance for your help!

Dan

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If( Hour( MyTimeStampField) >= 8 and Hour( MyTimeStampField) <= 16, 'MarketHours', 'something else') as MH

If( Hour( MyTimeStampField) >16 and Hour( MyTimeStampField) <= 23, 'AfterMarketHours', 'something else') as NMH

Or perhaps:

If( Hour( MyTimeStampField) >= 8 and Hour( MyTimeStampField) <= 16,1, 0) as MH

If( Hour( MyTimeStampField) >16 and Hour( MyTimeStampField) <= 23,1,0) as NMH


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Thank You Gysbert!

I ended up with a hybrid version of what you sent and it worked perfectly!

If(time(Time)>='07:59:00' and time(Time)<='16:00:00','Market Hours','After Market Hours') as [Market Hours],

Picture1.jpg