Hi all,
I have a date field object and my requirement is to add 10 working days to this object. Is there any way of doing this can you please help.
Thanks
nivas258 (BOB member since 2008-04-14)
Hi all,
I have a date field object and my requirement is to add 10 working days to this object. Is there any way of doing this can you please help.
Thanks
nivas258 (BOB member since 2008-04-14)
Try reading through these topics:
HTH
NMG
mcnelson (BOB member since 2008-10-09)
Hi,
I’ve read through the posts above but can’t find a solution to my specific issue with regards to adding working days to a specified date. My issue is as follows:
I need a result object which adds a specific number of working days to a date for the purposes of targetting. We have a calendar table in our universe which provided the date (linked to the originating date table) and a flag to indicate if a particular day is a working day or not. All i want to do is take that calendar date and add X number of working days to it. If there was an ID in the calendar field i’d just use that to count up to X where working_day=‘Y’ but no ID is available, the calendar only contains dates and the flag. I thought about converting the date to a number but T-SQL doesn’t seem to allow that. There must be a simple solution to this but my brain refuses to co-operate! Any ideas would be appreciated
Just so you know i don’t have access to change the calendar table, and we’re using Oracle 9 and BOXI 3.1 sp5.
Thanks
Chizo Ejindu
Xensor (BOB member since 2013-01-16)
Xensor,
Have you considered writing and using a function?
Pass in the date, have a cursor loop checking back ten working days then return the 10th working day. Could be fairly slow performing so you might want (assuming ten days back is a common requirement) to push it back to the calendar table as an extra column and just update that column the once.
Hi Mark,
Thanks for the response - unfortunately i have no access to the Oracle database so i cannot write functions or make updates/changes to the calendar table. Any solution would have to be universe or report based (preferably universe). I have seen a function-based solution on another website which could be adapted to fulfill my needs but as i say, i have no access . The obvious solution is to get the DBA to add this function but as our database is externally administered there would be a cost implication and a lead-in time and chances are my boss would not be willing to pay for it anyway.
Regards,
Chizo Ejindu
Xensor (BOB member since 2013-01-16)
Please find attached document for the requirement that I initially started the topic. I think it works but only thing is we have to add bank holidays to the varibale manually every year.
working days.doc (24.0 KB)
nivas258 (BOB member since 2008-04-14)
Hi nivas258,
Thanks for the document, it does look very promising. I do have however a concern about how it handles the addition of days, it doesn’t look like it will specific add additional working days for each bank holiday it calculates. If i write out an example perhaps it will explain my point better:
We have a start date of say Friday 24th December and a need to add 5 working days to that date. Part one of your calculation would return Friday 31st December which is correct. Then the second part would calculate 2 bank holidays in that period (27th and 28th in this example), which would mean an addition of 2 days to the date calculated in step one. However adding 2 days would push the result of step 3 to Sunday 2nd January which is not correct. In this example i think the actual correct result should be Tuesday 4th January as Monday the 3rd would also be a bank holiday.
Admittedly this is an edge case but i think it does highlight the issue when adding a day due to bank holidays pushes the result into the weekend or another bank holiday.
Regards,
Chizo Ejindu
Xensor (BOB member since 2013-01-16)
Hi Chizo,
Yes you are right, I dint recognize that error. Not sure if there is any other alternative solution for this. Please let me know if you find solution to resolve this issue.
Thanks
Nivas
nivas258 (BOB member since 2008-04-14)