COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: callmenagendra on 20 Jan 2015 07:14:01 AM

Title: how to get number of business days in a month
Post by: callmenagendra on 20 Jan 2015 07:14:01 AM
Hi All,

Am using below expression to calculate number of business days in a month.
if i use this data item as a row in a crosstab few columns are not displaying values.
Can anyone help me on this..

((cast(_days_between(?EndDate?,1900-01-01)/7,integer)*5)+if(_day_of_week(?EndDate?,1)>5) then (4) else (mod(_days_between(?EndDate?,1900-01-01),7))+1)
-
((cast(_days_between(?StartDate?,1900-01-01)/7,integer)*5)+if(_day_of_week(?StartDate?,1)>5) then (4) else (mod(_days_between(?StartDate?,1900-01-01),7))+1)
+
(if(_day_of_week(?StartDate?,1)<6) then (1) else (0))

Thanks in advance
Title: Re: how to get number of business days in a month
Post by: johnGQ on 20 Jan 2015 01:57:13 PM
try  to either create another query that wrap the query you used for the crosstab or put your computed field in the FM model, so crosstab see it only a number field.
Title: Re: how to get number of business days in a month
Post by: callmenagendra on 22 Jan 2015 04:53:04 AM
achieved...