Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to calculate the number of days between the two dates excluding the Fridays.
For Ex,
1.
Date1 : 01-Jun-2014
Date2 : 10-Jun-2014
No .of days =9, because 6th Jun 2014 is Friday
2.
Date1 : 01-Jun-2014
Date2 : 20-Jun-2014
No .of days =17, because 6th,13th and 20th Jun 2014 are Fridays.
Thanks in Advance.
In your load script create a WeekDay field and then use in expression like
Load
Weekday(DateField) as Weekday
From Loaction;
And in expression use it like
=Count( {<Weekday -= {'Fri'} >} YourDatefieldHere)
By doing this calculation from your data this expression exclude only friday dates and count rest of the dates
Something like:
=(EndDate-StartDate-Num(WeekDay(StartDate))-Floor(EndDate-StartDate-Num(WeekDay(StartDate))/7-If(Num(WeekDay(StartDate)<5,1,0)
This '5' stands for Saturday which may vary based on your time setting.
I feel there should be a simpler solution.
Hi Gopinathan
Please find attachment hope this will help you
-Rajendra
Hi you can even try like this
LOAD
DateFieldName,
If(WeekDay(DateFieldName) = 'Fri' , 1, 0) AS WeekEndFlag
FROM ABC;
Now in setanalysis expression use
=Count({<WeekEndFlag = {0}>} DateFieldName)
Regards
ASHFAQ