COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: DaniEU on 14 Jul 2018 08:46:40 AM

Title: Business hours in a time interval data item
Post by: DaniEU on 14 Jul 2018 08:46:40 AM
Hi,
I had a request to display a number of hours till a target time.
For instance we have a target date/time (let's say next Tuesday at 11AM) and the report should display time interval between NOW and this target date/time, but business hours only, so week end off and non working hours also off.
I'm using Cognos 10.2.2 against salesforce.com.

I can calculate number of hours but how can I remove the non working hours?
Working hours are Sunday-Thursday 08:00 - 17:00, Friday 08:00 - 12:00.

Thanks in advance,

Daniel
Title: Re: Business hours in a time interval data item
Post by: BigChris on 16 Jul 2018 01:02:01 AM
Hi Daniel,

It's going to be a mighty big calculation, unless someone has something that will already do it. Essentially, you're going to have to work out how many weeks there are between today and the end date so that you can work out the weekends, but even that is difficult since you're working on Sundays. I think there might be an options to say when the week starts (which would help you out with that) but I don't know for sure. Basically, there's nothing built in - you're going to have to work out all the bits between today and the target date then add them all up...it's not going to be easy.
Title: Re: Business hours in a time interval data item
Post by: DaniEU on 16 Jul 2018 01:43:58 AM
Hi BigChris,

I have an answer from another site that appears to be a simple solution.
I will create a new table with dates and values, where every day we have a value of work hours, where weekends, holly days, and so on will have a value of zero. Then just sum the dates between, and subtracting the first hours of the first day, and last hours of last day.
To create this table, I'm creating a Linux script.

Thanks for your help!