Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
What is the easiest way to identify the first workdate (Mon-fri) for each month?
I haven't tried this function myself. Will check.
In the meantime you may calculate it yourself in the code:
LOAD Monthname, date(min(Date)) as FirstWorkDate group by Monthname;
LOAD *, monthname(Date) as Monthname
where weekday(Date) < 5;
LOAD today()-recno() as Date autogenerate 365;
But that will slide over to the previous month sometimes and return e.g the last day of the previous month? How do I define no_of_workdays in a good way?
Thanks!
i think :
Today() - MonthStart(Today()) should do the trick
Mansyno
I haven't tried this function myself. Will check.
In the meantime you may calculate it yourself in the code:
LOAD Monthname, date(min(Date)) as FirstWorkDate group by Monthname;
LOAD *, monthname(Date) as Monthname
where weekday(Date) < 5;
LOAD today()-recno() as Date autogenerate 365;
But that will result in a date from a previous month?
=
firstworkdate('2009-04-10',Today() - MonthStart(Today()))
returns 3/11/2009 for example.
Yes I will do it in the load script instead. Thank you very much!