Hi,
I have to display data between 2 dates. But, I want to drop week-end.
I use a date prompt with a range selection. The date data is a DATE type
Example I select between 7 and 14 march but I don't want 12 and 13
How to do that?
Cheers,
Vinc
Hi Vinc,
You can use the Cognos function below to identify those dates that fall on a weekend and then filter them out in your query.
_day_of_week ( date_expression, integer )
Returns the day of week (1 to 7), where 1 is the first day of the week as indicated by the second parameter (1 to 7, 1 being Monday and 7 being Sunday). Note that in ISO 8601 standard, a week begins with Monday being day 1.
Example: _day_of_week ( 2003-01-01 , 1 )
Result: 3
Regards
Rob
Quote from: RobsWalker68 on 30 Mar 2011 08:37:16 AM
Hi Vinc,
You can use the Cognos function below to identify those dates that fall on a weekend and then filter them out in your query.
_day_of_week ( date_expression, integer )
Returns the day of week (1 to 7), where 1 is the first day of the week as indicated by the second parameter (1 to 7, 1 being Monday and 7 being Sunday). Note that in ISO 8601 standard, a week begins with Monday being day 1.
Example: _day_of_week ( 2003-01-01 , 1 )
Result: 3
Regards
Rob
Thx Rob
I added this filter :
dayofweek([data].[DATE])=2 OR dayofweek([data].[DATE])=3 OR dayofweek([data].[DATE])=4 OR dayofweek([data].[DATE])=5 OR dayofweek([data].[DATE])=6
It works ! ;)
Hi Vinc,
I'll echo what previous replies have said, and also direct you to a podcast that demonstrates this procedure.
Out at BSP Software's (IBM Cognos Partner (ISV)--podcast channel there is a recording on how to dynamically set the default values for date prompts. There is a downloadable script there as well that you can copy.
Podcast 2.17--http://www.bspsoftware.com/Support/PodcastChannel/tabid/228/Default.aspx
You can view BSP's various products, utilities, services, etc. out at www.BSPsoftware.com
Hope this helps!
Quote from: PetersonPro on 31 Mar 2011 01:41:08 PM
Hi Vinc,
I'll echo what previous replies have said, and also direct you to a podcast that demonstrates this procedure.
Out at BSP Software's (IBM Cognos Partner (ISV)--podcast channel there is a recording on how to dynamically set the default values for date prompts. There is a downloadable script there as well that you can copy.
Podcast 2.17--http://www.bspsoftware.com/Support/PodcastChannel/tabid/228/Default.aspx
You can view BSP's various products, utilities, services, etc. out at www.BSPsoftware.com
Hope this helps!
Thank you for the link! ;)