Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

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
Highlighted
MVP & Luminary
MVP & Luminary

Re: QlikView - Intervalmatch with weekends

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
Highlighted
MVP & Luminary
MVP & Luminary

Re: QlikView - Intervalmatch with weekends

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