Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have to pull data from a excel
Have date column as LogDate
I want to load only dates from Monday to Friday.
how will I be able to do it?
Try this:
LOAD
*
FROM excel
WHERE not(WeekDay(LogDate)=5 or Weekday(LogDate)=6); //5 is Saturday and 6 is Sunday
You can add a Where clause in Script:
Where WEEKDAY(LogDate) <= 4 ;
... or maybe :
.....where WeekDay(LogDate) < 5 ;
You can also refer the post
Hi
Where FirstWorkDate(LogDate) <> LogDate
The work day functions can take a list of holiday dates into consideration:
Set vHolidays = '2015/01/01', '2015/04/03', '2015/04/03'
Where FirstWorkDate(LogDate, 1, $(vHolidays)) <> LogDate
HTH
Jonathan
try this way,
I believe the best way,create a excel sheet with all day(work days and holidays) and set flag as 0 for holiday.
by comparing ur actual source file and new excel file ..u can only load working days/comapre today is work day or not in ur application.