Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
nrwlafhus
Contributor II
Contributor II

QlikView - Intervalmatch with weekends

I am trying to use a date and time field to flag weekend hours. How can I use "[Call Start Time]" to achieve this. The following scrip is what I currently have, but this is creating duplicate lines.

//Call Detail

CallDetail:

LOAD

   [Call Start Time],

  Date([Call Start Time], 'WWWW hh:mm:ss TT') as CallDayTime,

FROM....

//Weekend Intervals

Weekendint:

Load* inline [

from, to, weekend

Friday 06:00:00 PM, Monday 5:59:59 AM, Weekend

Monday 06:00:00 AM, Friday 5:59:59 PM, Weekday

];

1 Solution

Accepted Solutions
marcus_sommer

Maybe without intervalmatch like:

CallDetail:

LOAD

   [Call Start Time],

   Date([Call Start Time], 'WWWW hh:mm:ss TT') as CallDayTime,

   if(match(weekday([Call Start Time]), 'Sa', 'Su') or

         (weekday([Call Start Time]) = 'Fr' and frac([Call Start Time]) >= 18/24) or

         (weekday([Call Start Time]) = 'Mo' and frac([Call Start Time]) < 6/24),

         'Weekend', 'Weekday') as WeekdayFlag

FROM....

- Marcus

View solution in original post

1 Reply
marcus_sommer

Maybe without intervalmatch like:

CallDetail:

LOAD

   [Call Start Time],

   Date([Call Start Time], 'WWWW hh:mm:ss TT') as CallDayTime,

   if(match(weekday([Call Start Time]), 'Sa', 'Su') or

         (weekday([Call Start Time]) = 'Fr' and frac([Call Start Time]) >= 18/24) or

         (weekday([Call Start Time]) = 'Mo' and frac([Call Start Time]) < 6/24),

         'Weekend', 'Weekday') as WeekdayFlag

FROM....

- Marcus