Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Studio: Remove Sat and Sun from date timeframe

Status
Not open for further replies.

handpass

Programmer
Oct 13, 2006
10
US
Hi,
I am using Report Studio to develop reports for a manufacturing plant. In one of my reports I have a start-date and a finish-date, which I subtract from one another in order to get the number of days it took for a process to run.

The start and finish date can be weeks apart and I would like to just count working days, Monday - Friday. Is there anyway that I can remove the days Saturday and Sunday from the calculation?

Regards.
 
Mathematically you could formulate the following:
ANSWER = "Days Between" - (("Days Between" / 7) * 2 )

Steve N.
State of Ohio, MIS
 
Hi Steve,
I don't think your solution will solve my problem. For example, if a process starts on Monday 15th and finishes Friday 26th, that means that there is 12 days between the start and end date. What I want to do is remove Saturday and Sunday from the result so that I can show the process took 10 working days.

My start and end dates can begin and finish on any day and can be of varying duration.

Thanks,
Kevin.
 
Kevin,

I found these "solutions" in the COGNOS knowledgebase.
I'll try it today sometime if I get a chance.
I'd like to see if I can make it work.

91700.2 Number of working days between two dates
... Number of working days between two dates. ... Description: Is there a method to show
the number of working days between two dates, using only Impromptu functions. ...
Modified on May 01, 2006 Cases: 10 Collection: KB
Applies to: Impromptu 4.01 Impromptu 6.0 Impromptu 7.0 Impromptu 7.1


56307.3 Comparing number of days vs. day of month.
... In this given example, it compares the first 7 working days of this month
with the first 7 working days of last month. The seventh ...
Modified on Aug 31, 2006 Cases: 6 Collection: KB
Applies to: Cognos 8 BI Report Studio 8.1 PowerPlay Transformer 5.2 PowerPlay Transformer 7.1


1003549.1 How do you calculate the number of working days in a date range?
... Title: How do you calculate the number of working days in a date range? Updated: ...
Description: How do you calculate the number of working days in a date range? ...
Modified on Dec 16, 2006 Cases: 4 Collection: KB
Applies to: Cognos 8 BI Framework Manager 8.1 Cognos 8 BI Report Studio 8.1 Impromptu 7.0 Impromptu 7.1 Impromptu 7.3


82067.3 Working Days Between Two Dates
... Title: Working Days Between Two Dates. Updated: ... Description: Is there a method to
show the number of working days between two dates (excluding holidays)? ...
Modified on Aug 04, 2006 Cases: 12 Collection: KB
Applies to: Cognos 8 BI Access Manager 7.3 Cognos 8 BI Report Studio 8.1 Impromptu 5.0 Impromptu 7.0 Impromptu 7.1 Impromptu 7.3



Steve N.
State of Ohio, MIS
 
Maybe you could create a database function who will do it?
 
I have worked on a site that has a date dimension table with a 'working_day' flag column that is set to 1 for a working day and 0 for Saturday, Sunday and public holidays. Simply bring this flag into the query and SUM(working_day) to get the number of working days - push any complexity back to the DB layer whenever you can.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top