Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Make a date dimension for dashboarding

Received Response
234
Views
15
Comments
2»

Answers

  • bjbreitling
    bjbreitling Rank 3 - Community Apprentice

    Hi Thomas,

    I see this sql code is in Oracle SQL. Do you know where I would paste it to generate the date dimension. Would I just need to make an oracle database and bring it into the physical layer?

  • Thomas Dodds
    Thomas Dodds Rank 8 - Analytics Strategist
  • bjbreitling
    bjbreitling Rank 3 - Community Apprentice

    OK, Now I have 3 tables, one of them is a date table that has a bunch of dates from help above including month and year. The other two tables contain employee id and one contains each employee ids hirer date and the other eachs termination date (null if not terminated.) How do I join these in the physical layer, what measures do I need to create, and what would I have to show in the analysis layer to get an employee count by month.

    I know I need something like joining the dates in the physical layer but I'm not sure how to do it to give me the appropriate join to show what I want. I've tried joing the day in the date table to the termination date in the termination table and the hirer date in the hirers table. Then I make a count distinct measure of the employee id. Then when I show this in the analysis layer by month and year columns from the date table it doesn't give me the correct number. I also tried making a measure that gives a count of 1 when the hirer date is earlier than the month and the termination is null or greater than the month. This doesn't give me what I want either.

    I didn't think either of these would work but was testing them. Can anyone walk me through with moderately detailed steps what to do that will give me a monthly headcount that I can trend with.

  • Christian Berg-0racle
    Christian Berg-0racle Rank 10 - Analytics Guru

    EmpID/HireDate table = fact

    EmpId table (i hope there is more in there) = emp dim

    Date table = Date dim

    Measure = count distinct empid in fact table

  • Thomas Dodds
    Thomas Dodds Rank 8 - Analytics Strategist

    You need a fact table that stores the count of employees by date - if you want the historical 'inventory' of headcount.  It's a snapshot fact - take the snapshot on regular intervals (monthly, quarterly, weekly, etc)

    or if you don't care about measuring over time ... do what @Christian Berg has suggested.