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

Split time range into days

Hi,

I am super-new to Qlik Sense and still learning the basics. 

I have a split up of time ranges in my load statement and this is working, but now need to split the 8am to 5pm range into two separate ones - one that is for that time range Monday to Friday and one that is for that time range for Saturday and Sunday.  This is what I have for the original ranges:

"Operation DateTime"

   if ( ... ,'Midnight to 8am',

   if (..., '5pm to Midnight',

   if(timestamp(frac("Operation DateTime"),'hh:mm')>='08:00:00' and timestamp(frac("Operation DateTime"),'hh:mm') <'17:00:00', '8am to 5pm'))) as Timegroup

Any help greatly appreciated - my main load page has DayNames ="Mon,;Tue.;Wed.;Thu,;Fri,;Sat,;Sun.'; and the ReferenceDay=0;

Thanks

2 Replies
Anil_Babu_Samineni

May be remove seconds in the red color from below

 if(timestamp(frac("Operation DateTime"),'hh:mm')>='08:00:00' and timestamp(frac("Operation DateTime"),'hh:mm') <'17:00:00', '8am to 5pm'))) as Timegroup

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
locky
Contributor
Contributor
Author

Hi, thanks for the reply.

Sorry no, the script is working as is, whether there are seconds or not, but I have to duplicate it so I have two separate ones that include the current script but with an added condition that one will separate into weekdays and one into weekends.

 

So need the same time range as in the script, but also one with weekdays and one with weekends.