Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have an Opened Date and a Closed Date. I need the exact difference between the two excluding Weekends and Holidays in num format.
Using N/w days gives me value in whole numbers.
Eg:
Open Date | Closed date | Diff |
8/9/12 11:08 AM | 8/9/12 2:57 PM | 0.16 |
Regards.
works fine.. thank you...
Hi Stefan,
What is we have 10 hrs as working for weekday and 4hrs working for sat. we have to exclude sunday and holidays.
How can we modify the below code:
INPUT:
LOAD *, recno() as ID INLINE [
DT1, DT2
8/9/12 11:08 AM,8/9/12 2:57 PM
8/18/12 09:20 AM,8/20/12 01:13 PM
8/17/12 09:20 AM,8/20/12 01:13 PM
8/17/12 09:20 AM,8/19/12 01:13 PM
6/27/12 12:41 PM,7/6/12 4:38 PM
6/29/12 4:45 PM, 7/6/12 4:19 PM
8/1/12 09:00 AM, 8/3/12 10:00 AM
8/3/12 03:00 PM, 8/6/12 09:00 AM
];
TMP:
LOAD ID,
daystart(DT1)+iterno()-1 as Date,
if(iterno()=1, rangemin(rangemax(frac(DT1),maketime(8)),maketime(18)), maketime(8)) as Start,
if(daystart(DT1)+iterno()-1=daystart(DT2), rangemax(maketime(8),rangemin(frac(DT2),maketime(18))),Maketime(18)) as End
Resident INPUT
while daystart(DT2) >= daystart(DT1)+iterno()-1;
left join (INPUT)
LOAD
ID,
interval(sum(End-Start)) as Duration
Resident TMP where WeekDay(Date)<5 and not match(Date,$(vHol)) group by ID;