Is there a way to calculate the business date for each month, without creating a month group band?
When I use this formula using a month band it works great:
//begin formula
datevar fd;
datevar ld;
numbervar loop;
local numbervar busday;
numbervar span;
firstday:=date(year({ENTER_DATE}),month({ENTER_DATE}),1);
if month(fd)=12 then ld:=date(year(fd)+1,1,1)-1
else ld:=date(year(fd),month(fd)+1,1)-1;
span:=ld-fd;
For loop:= 0 to span do(
if dayofweek(fd+loop)in [2 to 6] then busday:=busday+1 else busday:=busday);
if date(2002,01,01) in fd to ld then busday:=busday-1;
busday
//end formula
What is being done is, this report is being grouped by companies and in the company group banding, it needs to show the business day count in there, but it will only show the count for the current month and none of the previous months. Is there a way to do this?
Any help is very much appreciated!
When I use this formula using a month band it works great:
//begin formula
datevar fd;
datevar ld;
numbervar loop;
local numbervar busday;
numbervar span;
firstday:=date(year({ENTER_DATE}),month({ENTER_DATE}),1);
if month(fd)=12 then ld:=date(year(fd)+1,1,1)-1
else ld:=date(year(fd),month(fd)+1,1)-1;
span:=ld-fd;
For loop:= 0 to span do(
if dayofweek(fd+loop)in [2 to 6] then busday:=busday+1 else busday:=busday);
if date(2002,01,01) in fd to ld then busday:=busday-1;
busday
//end formula
What is being done is, this report is being grouped by companies and in the company group banding, it needs to show the business day count in there, but it will only show the count for the current month and none of the previous months. Is there a way to do this?
Any help is very much appreciated!