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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
sarasmonu
Creator
Creator

Shift Calculation

Hi All,

I have a time field in my table and with that i need to create a shift dimension with 2 values: Day or Night.

If the time field falls between 6:30AM to 6:30PM then its a day shift if between 6:30PM to 6:30AM then night shift.


Time field is in the format DD-MM-YYYY HH:MM:SS


Please help me with this.


Thanks!

2 Replies
Anonymous
Not applicable

Maybe something like :

if (      frac(YourTimeField) > maketime ( 06 , 30 )

    and

         frac(YourTimeField) < maketime ( 18 , 30 ) 

    , 'Day' , 'Night' )

pablolabbe
Partner Ambassador
Partner Ambassador

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others