Kimball Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Financail calendar...seed data

2 posters

Go down

Financail calendar...seed data Empty Financail calendar...seed data

Post  GBS74 Wed Jul 29, 2009 5:29 pm

hi
I am tring to write pl/sql procedure to create financial calendar seed date. I have confusion about ... how to code to get financial week /period/start and end date for calendar if financial year and quarter start at first monday of April. any idea or script ?
regards

GBS74

Posts : 4
Join date : 2009-07-29

Back to top Go down

Financail calendar...seed data Empty Re: Financail calendar...seed data

Post  alex.caminals Mon Sep 28, 2009 8:49 am

I worked in a project in big corporation where they were using a fiscal calendar. We calculated the fiscal dates using the Oracle database function "ADD_MONTHS". In that scenario, the fiscal year began on 1st of March. So we had to substract two months to the calendar date to get the fiscal date.

SELECT any_date calendar_date, ADD_MONTHS (any_date, -2) fiscal_date
FROM DUAL

In your scenario, where the fiscal year begins on the first Monday of April the formula will be a little bit different. What I would do is something like this:

1. Calculate the "day_gap" for each year between your fiscal date and the calendar year (depending on the number of years to store, it may be easier to do that manually than finding a formula).
2. Substract the "day_gap" to each date in order to get the fiscal date (e.g. fiscal date 1-Jan-2009 will be the first Monday of April, 2-Jan-2009 the first Tuesday or April and so on).

That should make it. Let me know if you need further help.

Best regards,
alex.caminals
alex.caminals

Posts : 15
Join date : 2009-02-25
Age : 48
Location : Barcelona (Spain)

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum