If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Elegant way to create workday only time period at report level?

Started by Todd129, 23 Jan 2013 04:38:25 PM

Previous topic - Next topic

Todd129

Hi there--

I have two timestamps as separate data items, and am calculating the time difference between the two at the report level.

Does someone have a quick elegant idea for how to calculate this time difference omitting weekends in RS? What I'm after is the expired number of workdays, and so far I have the total elapsed calendar time.

Kind regards, Todd

RKMI

Hi Todd,

Not sure abt the elegant part but, we do something similar which does work.

Date Data Item:  _day_of_week([Time].[Date].[Date],1)

Then Data Item for identifying the weekdays from weekend
Day of Week Total:

CASE
WHEN ([Day of Week] = 1) THEN (0)
WHEN ([Day of Week] = 2) THEN (0)
WHEN ([Day of Week] = 3) THEN (0)
WHEN ([Day of Week] = 4) THEN (0)
WHEN ([Day of Week] = 5) THEN (0)
WHEN ([Day of Week] = 6) THEN (1)
WHEN ([Day of Week] = 7) THEN (1)
END

I do a similar thing to declare holidays then join them on the Date
then have a Workday counter data item as such,

Wknd/Holiday Counter:
CASE
WHEN (([Holiday Counter] = 0) OR ([Day of Week Total] = 0)) THEN (1)
ELSE (0)
END

Running Total for the total in calander: running-total([Wknd/Holiday Counter])

I know it looks messy but does work.

Thanks,
RK

Todd129

This is awesome -- thanks so much for supporting the community and sharing your expertise! :)

Todd