Hi, I’ve been searching the BOB but I haven’t found a satisfying answer yet, so here goes:
Is there a way to create a (derived?) table in a universe which contains all dates between a given start date and a given end date?
The story is I need to create a report containing number of days in a month where specific data is linked to. We can only use working days/ business days, so no weekend days.
F.E. I have a table with first and last dates of the months, but none of the dates between. There are other tables which have some of the dates I need…
Try something like this for the derived table, the Day of the week only brings back Mon- Fri.
SELECT
DTE.DAY_OF_WEEK,
DTE.CALENDAR_DATE
FROM
(
SELECT calendar_date,
TO_CHAR (calendar_date, ‘D’) as day_of_week
FROM DATE_DIM.Date
where to_char(DATE_DIM.CALENDAR_DATE, ‘D’)<> ALL(‘1’,‘7’)
) DTE