Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
];
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
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