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: 
ashimbhabak
Contributor
Contributor

Day Shift and Night Shift should be selected according to current time

Hi Everyone@,

I have a requirement where if a user opens an application from access point  between 08:00 AM to 08:00 PM then there is a field Shift Type, it should be Day Shift else it should be Night Shift. We are using =if(Time(now(),'hh:mm TT')>'08:00 AM' and Time(now(),'hh:mm TT')<'08:00 PM', 'DS','NS') condition but it gives NS every time. It is not changing according to current time. Please help.

1 Reply
MarcoWedel

Hi,

the Time - script and chart function does not change the numerical value of its argument, so one solution could be something like:


If(Frac(Now())>8/24 and Frac(Now())<20/24,'DS','NS')


hope this helps


regards


Marco