Cannot recreate mapping to populate MOLAP time dimension

I am using OWB10gR2 to create a time dimension having MOLAP as storage type and two hierarchies (year and week).
I used the wizard to create a time dimension having the standard year hierarchy. The wizard does not allow to generate the time dimension with both hierarchies (why?). That's why I had to manually add the week hierarchy with the object editor in a second step. The next step would be to recreate the mapping to populate the time dimension, but I got the following error message:
"There is no sequence attached to the dimension. Please add a sequence in the attribute tab."
I tried the same thing with ROLAP as storage types: for ROLAP I can recreate the mapping.
Does anybody have a solution for that problem?
Many thanks in advance!!

I further explored the Time dimension wizard and for standard if i select year,month and day .... the autogenerated mapping generates a validation error... Anyways i am using oracle11gr2 any ideas why this is happening ??

Similar Messages

  • Need help to populate Calendar/Time Dimension

    Hi,
    I need experts help in populating the calender dimension with the table structure as below. I need to populate this table from year 1900 to 2100. I was able to get the sql queries for some of the columns from web but could not find any help for most columns like 'DAY_IN_QUARTER'. If somebody could help me with a PL/SQL procedure to populate this table, I really appreciate your help. I know this is too much to ask for, but I have a time constraint in completing this!! :-(
    DM_CALENDAR_ID is the primary kay with date in julian format.
    Thanks in advance,
    Ganesh
    Calendar Dimension Table:
    DM_CALENDAR_ID
    DAY_NAME
    DAY_ABBREVIATION
    DAY_IN_WEEK
    DAY_IN_MONTH
    DAY_IN_QUARTER
    DAY_IN_YEAR
    WEEKDAY_IN_WEEK
    WEEKDAY_IN_MONTH
    WEEKDAY_IN_QUARTER
    WEEKDAY_IN_YEAR
    IS_MONTH_START_WEEKDAY
    IS_QUARTER_START_WEEKDAY
    IS_YEAR_START_WEEKDAY
    IS_MONTH_END_WEEKDAY
    IS_QUARTER_END_WEEKDAY
    IS_YEAR_END_WEEKDAY
    IS_MONTH_END
    IS_QUARTER_END
    IS_YEAR_END
    DAYS_TO_GO_IN_MONTH
    DAYS_TO_GO_IN_QUARTER
    DAYS_TO_GO_IN_YEAR
    WEEKDAYS_TO_GO_IN_MONTH
    WEEKDAYS_TO_GO_IN_QUARTER
    WEEKSDAYS_TO_GO_IN_YEAR
    MONTH_ID
    MONTH_LONG
    MONTH_SHORT
    MONTH_NUMBER_IN_YEAR
    MONTH_NUMBER_IN_QUARTER
    DAYS_IN_MONTH
    WEEKDAYS_IN_MONTH
    QUARTER_ID
    QUARTER_NAME
    QUARTER_NUMBER_IN_YEAR
    DAYS_IN_QUARTER
    WEEKDAYS_IN_QUARTER
    YEAR_ID
    DAYS_IN_YEAR
    WEEKDAYS_IN_YEAR
    CREATE_LOAD_DATE
    CREATE_LOAD_USER_NAME

    If somebody could help me with a PL/SQL procedure to populate this tablethis is one kind of proc, you can change according with your requirements...
    CREATE OR REPLACE PROCEDURE TIME_DIM_PROC
    (p_start_year IN NUMBER, p_end_year IN NUMBER) AS
    v_calendar_date DATE ;
    v_calendar_start_date DATE;
    v_calendar_end_date DATE;
    v_year NUMBER;
    v_calendar_day NUMBER;
    v_week_id VARCHAR2(12);
    v_week_start_date DATE;
    v_week_end_date DATE;
    v_week_number NUMBER;
    v_month NUMBER;
    v_month_mm VARCHAR2(5);
    v_month_start_date DATE;
    v_month_end_date DATE;
    v_month_id VARCHAR2(12);
    v_quarter_start_date DATE;
    v_quarter_end_date DATE;
    v_quarter_id VARCHAR2(12);
    v_half_year_start_date DATE;
    v_half_year_end_date DATE;
    v_half_year_id VARCHAR2(12);
    v_year_start_date DATE;
    v_year_end_date DATE;
    v_fiscal_week_id VARCHAR2(12);
    v_fiscal_week_month VARCHAR2(12);
    v_fiscal_month NUMBER;
    v_fiscal_month_start_date DATE;
    v_fiscal_month_end_date DATE;
    v_fiscal_month_id VARCHAR2(12);
    v_fiscal_quarter_start_date DATE;
    v_fiscal_quarter_end_date DATE;
    v_fiscal_quarter NUMBER;
    v_fiscal_quarter_id VARCHAR2(12);
    v_fiscal_half_year_start_date DATE;
    v_fiscal_half_year_end_date DATE;
    v_fiscal_half_year_id VARCHAR2(12);
    v_fiscal_year_start_date DATE;
    v_fiscal_year_end_date DATE;
    v_fiscal_year_id VARCHAR2(12);
    v_fiscal_year NUMBER;
    v_period_name VARCHAR2(12);
    v_year_yy VARCHAR2(12);
    v_year_id VARCHAR2(12);
    v_loop_counter NUMBER;
    v_number_of_days NUMBER;
    v_fiscal_month_name VARCHAR2(10);
    v_fiscal_quarter_name VARCHAR2(10);
    v_fiscal_half_name VARCHAR2(10);
    parameters_exception EXCEPTION;
    BEGIN
    IF p_start_year > p_end_year THEN
    RAISE parameters_exception;
    END IF;
    v_calendar_start_date := to_date( p_start_year || '-01-01','YYYY-MM-DD');
    v_calendar_end_date := to_date( p_end_year || '-12-31','YYYY-MM-DD');
    v_calendar_date := v_calendar_start_date -1;
    SELECT ( (v_calendar_end_date + 1 ) - v_calendar_start_date ) INTO v_number_of_days FROM dual;
    FOR v_loop_counter IN 1..v_number_of_days
    LOOP
    v_calendar_date := v_calendar_date + 1;
    v_year := TO_NUMBER(TO_CHAR(v_calendar_date,'YYYY'));
    v_year_yy := TO_CHAR(v_calendar_date,'YY');
    v_month := TO_NUMBER(TO_CHAR(v_calendar_date,'MM'));
    v_month_mm := TO_CHAR(v_calendar_date,'MM');
    v_calendar_day := TO_NUMBER(TO_CHAR(v_calendar_date,'DD'));
    v_month_start_date := add_months(last_day( v_calendar_date ) +1 ,-1) ;
    v_month_end_date := last_day( v_calendar_date );
    v_week_id :=
    CASE WHEN v_calendar_day BETWEEN 1 AND 7 THEN 'WK1'
    WHEN v_calendar_day BETWEEN 8 AND 14 THEN 'WK2'
    WHEN v_calendar_day BETWEEN 15 AND 21 THEN 'WK3'
    WHEN v_calendar_day BETWEEN 22 AND 28 THEN 'WK4'
    ELSE 'WK5'
    END ;
    v_week_id := v_week_id || '-' || v_month_mm || '-' || v_year_yy;
    v_week_start_date :=
    CASE WHEN v_calendar_day BETWEEN 1 AND 7 THEN add_months(last_day( v_calendar_date ) +1 ,-1)
    WHEN v_calendar_day BETWEEN 8 AND 14 THEN add_months(last_day( v_calendar_date) +1 ,-1) + 7
    WHEN v_calendar_day BETWEEN 15 AND 21 THEN add_months(last_day( v_calendar_date ) +1 ,-1) + 14
    WHEN v_calendar_day BETWEEN 22 AND 28 THEN add_months(last_day( v_calendar_date ) +1 ,-1) + 21
    ELSE add_months(last_day( v_calendar_date) +1 ,-1) + 28
    END ;
    v_week_end_date :=
    CASE WHEN v_calendar_day BETWEEN 1 AND 7 THEN add_months(last_day( v_calendar_date ) +1 ,-1) + 6
    WHEN v_calendar_day BETWEEN 8 AND 14 THEN add_months(last_day( v_calendar_date) +1 ,-1) + 13
    WHEN v_calendar_day BETWEEN 15 AND 21 THEN add_months(last_day( v_calendar_date ) +1 ,-1) + 20
    WHEN v_calendar_day BETWEEN 22 AND 28 THEN add_months(last_day( v_calendar_date ) +1 ,-1) + 27
    ELSE last_day( v_calendar_date )
    END ;
    v_week_number :=
    CASE WHEN v_calendar_day BETWEEN 1 AND 7 THEN 1
    WHEN v_calendar_day BETWEEN 8 AND 14 THEN 2
    WHEN v_calendar_day BETWEEN 15 AND 21 THEN 3
    WHEN v_calendar_day BETWEEN 22 AND 28 THEN 4
    ELSE 5
    END ;
    v_period_name :=
    case when v_month = 1 then 'JAN'
    when v_month = 2 then 'FEB'
    when v_month = 3 then 'MAR'
    when v_month = 4 then 'APR'
    when v_month = 5 then 'MAY'
    when v_month = 6 then 'JUN'
    when v_month = 7 then 'JUL'
    when v_month = 8 then 'AUG'
    when v_month = 9 then 'SEP'
    when v_month = 10 then 'OCT'
    when v_month = 11 then 'NOV'
    else 'DEC'
    end || '-' || v_year_yy;
    v_month_id :=
    case when v_month = 1 then 'M01'
    when v_month = 2 then 'M02'
    when v_month = 3 then 'M03'
    when v_month = 4 then 'M04'
    when v_month = 5 then 'M05'
    when v_month = 6 then 'M06'
    when v_month = 7 then 'M07'
    when v_month = 8 then 'M08'
    when v_month = 9 then 'M09'
    when v_month = 10 then 'M10'
    when v_month = 11 then 'M11'
    else 'M12'
    end || '-' || v_year_yy;
    v_quarter_start_date := case
    when v_month between 1 and 3 then to_date( v_year || '-' || '01-01' , 'YYYY-MM-DD')
    when v_month between 4 and 6 then to_date( v_year || '-' || '04-01' , 'YYYY-MM-DD')
    when v_month between 7 and 9 then to_date( v_year || '-' || '07-01' , 'YYYY-MM-DD')
    else to_date( v_year || '-' || '10-01' , 'YYYY-MM-DD')
    end;
    v_quarter_end_date := case
    when v_month between 1 and 3 then to_date( v_year || '-' || '03-31' , 'YYYY-MM-DD')
    when v_month between 4 and 6 then to_date( v_year || '-' || '06-30' , 'YYYY-MM-DD')
    when v_month between 7 and 9 then to_date( v_year || '-' || '09-30' , 'YYYY-MM-DD')
    else to_date( v_year || '-' || '12-31' , 'YYYY-MM-DD')
    end;
    v_quarter_id := case
    when v_month between 1 and 3 then 'Q1'
    when v_month between 4 and 6 then 'Q2'
    when v_month between 7 and 9 then 'Q3'
    else 'Q4'
    end || '-' || v_year_yy;
    v_half_year_start_date :=
    case
    when v_month between 1 and 6 then to_date( v_year || '-' || '01-01' , 'YYYY-MM-DD')
    else to_date( v_year || '-' || '07-01' , 'YYYY-MM-DD')
    end;
    v_half_year_end_date :=
    case
    when v_month between 1 and 6 then to_date( v_year || '-' || '06-30' , 'YYYY-MM-DD')
    else to_date( v_year || '-' || '12-31' , 'YYYY-MM-DD')
    end;
    v_half_year_id :=
    case
    when v_month between 1 and 6 then 'HALF1'
    else 'HALF2'
    end || '-' || v_year_yy ;
    v_year_start_date := to_date( v_year || '-' || '01-01' , 'YYYY-MM-DD') ;
    v_year_end_date := to_date( v_year || '-' || '12-31' , 'YYYY-MM-DD') ;
    v_year_id := 'YR-' || substr(to_char(v_year),3,4) ;
    v_fiscal_month_start_date:=add_months(last_day( v_calendar_date ) +1 ,-1) ;
    v_fiscal_month_end_date:= last_day( v_calendar_date );
    v_fiscal_month :=
    case
    when v_month = 1 then 10
    when v_month = 2 then 11
    when v_month = 3 then 12
    when v_month = 4 then 1
    when v_month = 5 then 2
    when v_month = 6 then 3
    when v_month = 7 then 4
    when v_month = 8 then 5
    when v_month = 9 then 6
    when v_month = 10 then 7
    when v_month = 11 then 8
    else 9
    end ;
    v_fiscal_month_id :=
    case
    when v_month = 1 then 'M10' || '-' || substr(to_char((v_year-1)),3,4)
    when v_month = 2 then 'M11' || '-' || substr(to_char((v_year-1)),3,4)
    when v_month = 3 then 'M12' || '-' || substr(to_char((v_year-1)),3,4)
    when v_month = 4 then 'M01' || '-' || substr(to_char((v_year)),3,4)
    when v_month = 5 then 'M02' || '-' || substr(to_char((v_year)),3,4)
    when v_month = 6 then 'M03' || '-' || substr(to_char((v_year)),3,4)
    when v_month = 7 then 'M04' || '-' || substr(to_char((v_year)),3,4)
    when v_month = 8 then 'M05' || '-' || substr(to_char((v_year)),3,4)
    when v_month = 9 then 'M06' || '-' || substr(to_char((v_year)),3,4)
    when v_month = 10 then 'M07' || '-' || substr(to_char((v_year)),3,4)
    when v_month = 11 then 'M08' || '-' || substr(to_char((v_year)),3,4)
    else 'M09' || '-' || substr(to_char((v_year)),3,4)
    end ;
    v_fiscal_quarter_start_date :=
    case
    when v_month between 1 and 3 then to_date( v_year || '-' || '01-01' , 'YYYY-MM-DD')
    when v_month between 4 and 6 then to_date( v_year || '-' || '04-01' , 'YYYY-MM-DD')
    when v_month between 7 and 9 then to_date( v_year || '-' || '07-01' , 'YYYY-MM-DD')
    else to_date( v_year || '-' || '10-01' , 'YYYY-MM-DD')
    end;
    v_fiscal_quarter_end_date :=
    case
    when v_month between 1 and 3 then to_date( v_year || '-' || '03-31' , 'YYYY-MM-DD')
    when v_month between 4 and 6 then to_date( v_year || '-' || '06-30' , 'YYYY-MM-DD')
    when v_month between 7 and 9 then to_date( v_year || '-' || '09-30' , 'YYYY-MM-DD')
    else to_date( v_year || '-' || '12-31' , 'YYYY-MM-DD')
    end;
    v_fiscal_quarter :=
    case
    when v_month between 1 and 3 then 4
    when v_month between 4 and 6 then 1
    when v_month between 7 and 9 then 2
    else 3
    end;
    v_fiscal_quarter_id :=
    case
    when v_month between 1 and 3 then 'Q4' || '-'|| substr(to_char((v_year-1)),3,4)
    when v_month between 4 and 6 then 'Q1' || '-'|| substr(to_char((v_year)),3,4)
    when v_month between 7 and 9 then 'Q2' || '-'|| substr(to_char((v_year)),3,4)
    else 'Q3' || '-'|| substr(to_char((v_year)),3,4)
    end;
    v_fiscal_half_year_start_date :=
    case
    when v_month between 4 and 9 then to_date(v_year ||'-04-01','YYYY-MM-DD')
    when v_month between 10 and 12 then to_date(v_year ||'-10-01','YYYY-MM-DD')
    else to_date((v_year-1) ||'-10-01','YYYY-MM-DD')
    end;
    v_fiscal_half_year_end_date :=
    case
    when v_month between 4 and 9 then to_date(v_year ||'-09-30','YYYY-MM-DD')
    when v_month between 10 and 12 then to_date(v_year ||'-03-31','YYYY-MM-DD')
    else to_date((v_year) ||'-03-31','YYYY-MM-DD')
    end;
    v_fiscal_half_year_id :=
    case
    when v_month between 4 and 9 then 'HALF1' || '-' || substr(to_char((v_year)),3,4)
    when v_month between 10 and 12 then 'HALF2' || '-' || substr(to_char((v_year)),3,4)
    else 'HALF2' || '-' || substr(to_char((v_year-1)),3,4)
    end;
    v_fiscal_year_start_date :=
    case
    when v_month between 4 and 12 then to_date(v_year ||'-04-01','YYYY-MM-DD')
    else to_date((v_year-1) ||'-04-01','YYYY-MM-DD')
    end;
    v_fiscal_year_end_date :=
    case
    when v_month between 4 and 12 then to_date((v_year+1) ||'-03-31','YYYY-MM-DD')
    else to_date((v_year) ||'-03-31','YYYY-MM-DD')
    end;
    v_fiscal_year_id :=
    case
    when v_month between 4 and 12 then 'FY' || '-' || substr(to_char((v_year)),3,4)
    else 'FY' || '-' || substr(to_char((v_year-1)),3,4)
    end;
    v_fiscal_year :=
    case
    when v_month between 4 and 12 then v_year
    else (v_year-1)
    end;
    v_fiscal_month_name :=
    case when v_month = 1 then 'JAN'
    when v_month = 2 then 'FEB'
    when v_month = 3 then 'MAR'
    when v_month = 4 then 'APR'
    when v_month = 5 then 'MAY'
    when v_month = 6 then 'JUN'
    when v_month = 7 then 'JUL'
    when v_month = 8 then 'AUG'
    when v_month = 9 then 'SEP'
    when v_month = 10 then 'OCT'
    when v_month = 11 then 'NOV'
    else 'DEC'
    end;
    v_fiscal_quarter_name :=
    case
    when v_month between 1 and 3 then 'Q4'
    when v_month between 4 and 6 then 'Q1'
    when v_month between 7 and 9 then 'Q2'
    else 'Q3'
    end;
    v_fiscal_half_name :=
    case
    when v_month between 4 and 9 then 'HALF1'
    else 'HALF2'
    end;
    INSERT INTO TIME_DIM
    VALUES
    ( TIME_KEY_S.NEXTVAL ,
    v_calendar_date,
    'STANDARD-FISCAL',
    v_week_start_date,
    v_week_end_date ,
    v_week_id ,
    v_week_number ,
    v_period_name,
    v_month_start_date,
    v_month_end_date,
    v_month_id,
    v_quarter_start_date,
    v_quarter_end_date,
    v_quarter_id,
    v_half_year_start_date,
    v_half_year_end_date,
    v_half_year_id,
    v_year_start_date,
    v_year_end_date,
    v_year_id,
    v_year,
    v_week_start_date,
    v_week_end_date ,
    v_week_id ,
    v_week_number ,
    v_fiscal_month_start_date,
    v_fiscal_month_end_date,
    v_fiscal_month,
    v_fiscal_month_id,
    v_fiscal_quarter_start_date,
    v_fiscal_quarter_end_date,
    v_fiscal_quarter,
    v_fiscal_quarter_id,
    v_fiscal_half_year_start_date,
    v_fiscal_half_year_end_date,
    v_fiscal_half_year_id,
    v_fiscal_year_start_date,
    v_fiscal_year_end_date,
    v_fiscal_year_id,
    v_fiscal_year,
    1,
    sysdate,
    sysdate,
    user,
    user,
    -1,
    v_fiscal_month_name,
    v_fiscal_quarter_name,
    v_fiscal_half_name
    COMMIT;
    END LOOP;
    COMMIT;
    DBMS_OUTPUT.PUT_LINE ( 'v_calendar_date ' || v_calendar_date);
    DBMS_OUTPUT.PUT_LINE ( 'v_year ' || v_year );
    DBMS_OUTPUT.PUT_LINE ( 'v_month ' || v_month);
    DBMS_OUTPUT.PUT_LINE ( 'v_month_start_date ' || v_month_start_date);
    DBMS_OUTPUT.PUT_LINE ( 'v_month_end_date ' || v_month_end_date );
    DBMS_OUTPUT.PUT_LINE ( 'v_period_name ' || v_period_name );
    DBMS_OUTPUT.PUT_LINE ( 'v_month_id ' || v_month_id);
    DBMS_OUTPUT.PUT_LINE ( 'v_quarter_start_date ' || v_quarter_start_date);
    DBMS_OUTPUT.PUT_LINE ( 'v_quarter_end_date ' || v_quarter_end_date);
    DBMS_OUTPUT.PUT_LINE ( 'v_quarter_id ' || v_quarter_id);
    DBMS_OUTPUT.PUT_LINE ( 'v_half_year_start_date ' || v_half_year_start_date);
    DBMS_OUTPUT.PUT_LINE ( 'v_half_year_end_date ' || v_half_year_end_date);
    DBMS_OUTPUT.PUT_LINE ( 'v_half_year_id ' || v_half_year_id);
    DBMS_OUTPUT.PUT_LINE ( 'v_year_start_date ' || v_year_start_date);
    DBMS_OUTPUT.PUT_LINE ( 'v_year_end_date ' || v_year_end_date);
    DBMS_OUTPUT.PUT_LINE ( 'v_year ' || v_year);
    DBMS_OUTPUT.PUT_LINE ( 'v_fiscal_month ' || v_fiscal_month);
    DBMS_OUTPUT.PUT_LINE ( 'v_fiscal_month_id ' || v_fiscal_month_id);
    DBMS_OUTPUT.PUT_LINE ( 'v_fiscal_quarter_start_date ' || v_fiscal_quarter_start_date);
    DBMS_OUTPUT.PUT_LINE ( 'v_fiscal_quarter_end_date ' || v_fiscal_quarter_end_date);
    DBMS_OUTPUT.PUT_LINE ( 'v_fiscal_quarter ' || v_fiscal_quarter);
    DBMS_OUTPUT.PUT_LINE ( 'v_fiscal_quarter_id ' || v_fiscal_quarter_id);
    DBMS_OUTPUT.PUT_LINE ( 'v_fiscal_half_year_start_date ' || v_fiscal_half_year_start_date);
    DBMS_OUTPUT.PUT_LINE ( 'v_fiscal_half_year_end_date ' || v_fiscal_half_year_end_date);
    DBMS_OUTPUT.PUT_LINE ( 'v_fiscal_half_year_id ' || v_fiscal_half_year_id );
    DBMS_OUTPUT.PUT_LINE ( 'v_fiscal_year_start_date ' || v_fiscal_year_start_date);
    DBMS_OUTPUT.PUT_LINE ( 'v_fiscal_year_end_date ' || v_fiscal_year_end_date);
    DBMS_OUTPUT.PUT_LINE ( 'v_fiscal_year_id ' || v_fiscal_year_id );
    DBMS_OUTPUT.PUT_LINE ( 'v_fiscal_year ' || v_fiscal_year );
    EXCEPTION
    WHEN parameters_exception THEN
    raise_application_error (-20001,'PASS p_start_date lesser than or equal to p_end_date');
    WHEN OTHERS THEN
    raise_application_error(-20002,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
    END;
    /

  • Populating the time dimension in ODI

    I need to populate my time dimension in ODI> I read a solution in this forum suggesting to create a time table/view in the source schema, reverse it in ODI and then use it as source to populate the time dimension. Is there another way to do this? One way I thought of was to use the ORDERDATE field in my ORDER table (my source table in Oracle) and map it to my time dimension in SQL Server via an interface. But I also have DUEDATE, SHIPDATE and PAYDATE fields in my ORDERS table and this approach would mean that I have to map them through separate interfaces to the time dimension as well. I have created a procedure in the source schema(Oracle) and want to use it in ODI to populate the time dimension. But I amnt sure if that is possible in ODI. Could anyone help me with this please?
    Regards,
    Neel

    Hi Neelab,
    Sorry for my delay to reply you, I had no time the lasts days...
    To get the four distinct key from your time dimension, just add four instance of dimension table at interface each one joined with one of the columns.
    I believe that you load your time dimension from some other table than PRJ_TBL_TRANSACTION because you have the HolidayType column in your time dimension...
    A view is one possible solution to load the time table but depends how the performance of the query is.
    A way to do it at ODI is:
    - Create 4 interfaces, one for each column, to load 1 singe table with 1 single date column, don't worry about duplicated value at this time, than you can just use the "IKM Control Append" that has more performance but check the "Distinct" box (flow tab) at each interface
    - Create a last interface from this temp table as source, to the time dimension target table. Now you will use the "IKM Incremental Update" and do choose the "Update" option to "NO". Check the "Distinct" box.
    As this table will have no more than 6.200 records from the last 20 years it will be a small table where you shouldn't have performance problems.
    These are some of possible solutions but I would like to add other "way to think".
    By the table that you show here you have a simple time table with no special feature, for that, let me suggest you other way.
    - in the current way you will join but didn't get the record that "fail" from the join once they will be exclude if a date do not exist at time dimension
    My suggestion:
    - Load the dimension time table from your source table
    - as PK in time dimension table, use the ''Julian Day"
    - At ODI target fact table (datastore), create a 4 reference constraints (one by column) to the time dimension
    - at interface do not use the dimension as source and transform the 4 date to Julian and let the 4 constraints take care if they exists or not at dimension table.
    OR
    - Look for the minimum "possible" date at your company
    - populate your time dimension with every each day since then until a future date (Dec 31, for instance)
    - create a process to populate the future date that will be execute in a interval that you decide (once a year, once a month, as you wish) dependent on how further the date is populated
    - use the "Julian date" as PK
    - At interface just transform any date to "Julian Date" it will be at dimension time once it is naturally unique
    You could substitute the Julian date for "YYYYMMDD" that is a unique value too.
    I presented you 2 way to consider be considered, each one could be used based on how important is for the business know if a date was loaded or not.
    Someone can question that has the dates loaded from source against has all dates previous loaded could help to find errors from days that wasn’t loaded but it has a failure. As there are 4 dates source columns (and we are talking just about one source table until now) if a date loaded math a date when the load failure there is no value in use the time dimension date to analyze this possibility.
    I defend the full time dimension load.
    Make sense and/or help you??

  • How to time dimension

    How do you link a time dimension to the fact table?
    If the time dimension has a sequence as the PK then
    the following columns:
    year
    month
    quarter
    day
    time
    etc..
    How is the fact table connected to the time dimension if the fact table has the
    primary key as a FK in the fact table?
    -Jim

    Hi Ragnar
    Because a date is in fact stored as a number you don't need a surrogate key for your time dimension. You can make the primary key the date itself. Then you just join from the fact to the time dimension on the date.
    Oh yes, you would need to populate the time dimension before loading the fact table. But then this is true of all star schemas. You must populate the dimensions before you populate the facts.
    However, in the case of time, because it never changes over time (pardon the pun) you could load years of dates way out into the future. Then you would never have to worry about it for a while.
    I have customers who are using E-Business Suite where the time dimension is fed from GL_PERIODS and BOM_CALENDAR_DATES. Because the periods are entered once per year in most cases then they only need to run the load once per year. Matrialized vieww of time work well too.
    Hope this helps
    Regards
    Michael

  • Time Dimension

    I have created a Time dimension using the Dimension Wizard with two hierarchies:
    Year - Quarter - Month - Date
    Year - Week - Date
    We have a data warehouse with two fact tables, FactSite and FactWell.
    Each table contains a different date field and we hope to use the Time dimension as a role playing dimension for each.
    So we wish to filter FactSite and FactWell data by
    Year - Quarter - Month - Week - Date using
    the operational date fields.
    My queries are. Must we now:
    1 - Populate (using wizard) the Time dimension with a suitable date range? (i.e. the start date and expected end date of our data set).
    Then during our ETL process, we do a lookup in the Time dimension and set the surrogate key in the corresponding fact table.
    2 - Populate the Time dimension during the
    ETL process from our OLTP data source? 
    3 - What is the best practice for this type of scenario?

    Hi Darren,
    According to your description, you need a time table to create your time dimension, now you want to know which is better, creating the time table in the project or creating the table in the OLTP data source during ETL process, right?
    Microsoft SQL Server Analysis Services provide a convenient way to create time table, you can use the Dimension Wizard in SQL Server Data Tools (SSDT) to create a time dimension when no time table is available in the source database. As per my understanding,
    it better to generate the time table in data source view using wizard. Please refer to the link below to see the details.
    http://msdn.microsoft.com/en-us/library/ms174832.aspx
    Then you can create a Date hierarchy Year - Quarter - Month - Week - Date using this time table.
    http://msdn.microsoft.com/en-IN/library/hh231692.aspx
    Regards,
    Charlie Liao
    TechNet Community Support

  • Time dimension (Using Wizard)

    Hi
    i want to create Time dimension using simple wizard(not through time wizard)
    i have following attributes in it
    Year( year ID,year Discription)
    Quarter(Quarter ID,Quarter Discription)
    Month ( Month ID,Month Discription)
    Week ( week ID,week Discription)
    DAY ( Day ID,Day Discription)
    Hours ( hours ID,hours Discription)
    i complete time dimension with simple wizard but it create sequence and table
    so what is mapping for it kindly give me guide in detail
    thnx in advance

    Hi,
    you may create your custom time dimension using the simple wizard.
    To fill it with values, create another time dimension with the time dimension wizard. Fill it using the generated mapping.
    Then write your own mapping to fill your time dimensions with the values from the generated one.
    This way is easier than to write some custom logic to fill your custom time dimension.
    Regards,
    Carsten.

  • Populte "holiday" column of time dimension

    hi,
    i am creating time dimension.
    I want to populate the time dimension table.
    How do i populate the "holiday column".
    structure of my table is:
    create table schema_owner.dimension_time (
    calendar_date date,
    day_of_year_number number,
    day_of_week varchar2(9), -- day name.
    week_number number, -- accounting week number(also known as period).
    week_ending date, -- ends on friday.
    accounting_month_end date, -- last friday of month.
    calendar_month_end date, -- last day of month.
    month_day_number number, -- day of month.
    month varchar2(9), -- month name.
    month_number number, -- number of month in year.
    quarter_number number, -- ends on accounting month end.
    holiday varchar(1) -- flag 'Y' is holiday, 'N' is no holiday.
    ) tablespace time_data ;
    i am not able to populate the "holiday" column.
    Please help me on this .

    Hi,
    You can use a CASE expression to return one thing for Sundays, and something else for every other day, like this:
    CASE
        WHEN  TO_CHAR ( sd + rn
                      , 'fmDay'
                , 'NLS_DATE_LANGUAGE=ENGLISH'     -- If necessary
                ) = 'Sunday' 
           THEN  'Holiday'
           ELSE     'Work Day'     -- or NULL
    ENDIf you want to include other holidays, either fixed dates (such as Juanaury 1) or variable dates (such as the 4th Thursday in November), then see this thread:
    Re: retrieving 7 business days
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data.
    If you're asking about a DML statement, such as INSERT, the sample data will be the contents of the table(s) before the DML, and the results will be state of the changed table(s) when everything is finished.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using.

  • Error While Loding Time Dimension

    Hello
    I have a requirement in which i need to load the data into Time dimension so i mapped the data from Time dimension which Oracle Creates
    While deploying i am getting an Error which says there is an error in Time Dimension Package which is created by oracle and
    Can anyone tell me where should i go to rectify the error
    Thanks
    Sriks

    Did the mapping validate ok?
    If validation was ok, locate the package on the DB (same name as mapping) and compile it, this should give you more information on what is causing the error e.g. table does not exist etc.
    Si

  • TIME dimension processing fails saying "..attribute key cannot be found.." in EPM 10

    After upgrading from version 7.5 to EPM 10, when we ran a ‘Full Process’ on the TIME dimension, it ran into an error saying “Errors in the OLAP storage engine: The attribute key cannot be found when processing: Table: 'dbo_tblFactCapEx', Column: 'TIMEID', Value: '20090013'. The attribute is 'Time_TIMEID'.  (1/13/2015 2:41:02 PM)”.
    Full error message is attached herewith – ‘Time Dimension Error.txt’
    After researching, we did discover that MONTHNUM needed to be converted to BASE_PERIOD. Re-processed which produced the same error.
    Prior to migration to version 7.5, we ran a full process on TIME dimension there. It completed successfully, confirming the issue is only with version 10.
    Confirmed we could see the TIMEID value of 20090013 in the following places:
    Time Dimension in the appropriate TIMEID attribute column.
    Confirmed mbrTIME table had base member ID with TIMEID attribute filled out correctly.
    Data in tblFactFINANCE could be pulled using that TIMEID
    We truncated all the records in all the fact tables associated to this TIME dimension.
    Eventually, when none of the tables had any records, the TIME dimension then processed successfully.
    We this began to suspect the issue may not really be related to bad records.
    We conducted one more test to confirm this.
    Using an input form in EPM 10, we manually entered data in one of the models (at this point none of the fact tables have any records)
    Ran Full Optimize on that model with Compress Database and Index Defragmentation checked – This step failed with the error attached in ‘MatrixRateFullOptimize.txt’
    Ran Full process on Time Dimension – Failed indicating issue with TimeID 2012001 (that’s my manual entry). Attached error report ‘TimeDim Error MatrixRate.txt’
    At this point, the table only contains the manually entered records (no suspected bad records)
    We then suspected there could have been an issue with the upgrade process.
    So we reprocessed all the dimension and optimized all the models in version 7.5, made a new backup and restored it to version 10.
    The issue still persisted!
    At this point, we have tried all the possibilities we could think of. Each time the fact table is populated with records, the TIME dimension process fails indicating ‘the attribute key’ cannot be found.
    There is probably something in the OLAP partition that is not able to link the dimension attributes to the cubes.
    Additional Information:
    Please find attached the existing Time Dimension – TimeDimensionMembers.xlxs
    Version of Excel used: Excel 2007, SP3 MSO (12.0.6683.5000)
    System Specs: Please see screenshot below.

    Thank you all for responding! This issue is resolved.
    Here’s what the issue was:
    The time structure is TOTAL >> Years >> Quarters >> Months (e.g. T.ALL >> 2012.TOTAL >> 2012.Q1 >> 2012.P01)
    As shown in the screenshot below, the LEVEL for ‘T.ALL’ member was set to YEAR, which is incorrect (we can’t have Year rolling up to a Year)
    We changed the LEVEL to ‘TOTAL’ and this fixed the issue!!
    If only it gave a better error message than the “..attribute key not found” message

  • Time Dimension Wizard Hangs Creating Map

    I'm running OWB 11.1.0.7 and trying to create a time dimension using the time dimension wizard and when I get to the progress screen it just hangs when it gets to 60% progress and the message window says it's creating the map.
    There is no indication of any kind of error that might say why it's hanging, or any indication other than "creating map" that says what it's trying to do at the time. Is there anyway to dig under the covers anywhere to see what the wizard is trying to do that is causing it to hang?
    Another question is how I can create the same kind of dimension manually that the wizard would have created? It appears to be creating a special kind of dimension, specifically for time but I can't see anyway to create it manually if the wizard doesn't work. I found another message that mentioned a time dimension template that the wizard uses but that post was about how to use OMBPlus to remove the time template type so it could be edited manually, not how to create one using it.
    So, anyone have any suggestions for how I can track this problem down and/or create that time dimension manually? Thanks.
    Regards, Bob

    Are you using OWB 11.1.0.7 or greater?
    We encountered the same problem from that version on. try to use an older version (11.1.0.6 client definitely works).
    We will put this into metalink as it is definitely a bug.
    Cheers,
    Knut

  • How to populate the time component of a cube?

    We have a question regarding how to populate the time component of a cube. Let me explain:
    We are using OWB 10gR2. We have created a cube with several dimensions. We are now building the mapping to load the cube. The cube operator has two columns for every dimension (e.g., "customer" and "customer_id" for the "customer" dimension).
    We understand that, in this case, "customer_id" stands for the dimension business key, so we create an arrow from the business key in the source table to the "customer_id" column in the cube operator.
    So far so good. The mapping works all right, and the cube is loaded correctly.
    Now we need to do the same for the time dimension. We have already created the time dimension and we have loaded it. We have also included it in the cube, so now we have two new columns in it: "time_day_code" and "time", both NUMBER data type.
    We have the "sale_date" column (DATE data type), in the source system and, of course, now we want to populate the date column in the cube. We suppose that, somehow, we have to translate the "sale_date" field into the numeric column of the surrogate key of the time dimension. How should do we do this? I suppose that OWB must do the translation for us, just as it does for the other dimensions, but how? We have been looking into the manuals, and we have found no explanation on how to go about this.
    Any help would be appreciated.
    Best regards
    Juan Algaba

    Hi Juan
    You are right this should have been in the manuals, checked and there is only a brief mention (Using a Time Dimension in a Cube Mapping section)
    The identifier format should have been documented for each level and will involve creating the formatted attribute for input to the cube operator's time dimension reference attribute.
    The time dimension business keys are stored as follows;
    Day Level - YYYYMMDD
    Month Level - YYYYMM
    Week Level - YYYYWW
    Quarter - YYYYQ
    Year - YYYY
    If you have a source that has a SQL date datatype for example and want to construct the key for a cube's time dimension at the day level something like the following expression can be used to construct the time reference from a SQL date...
    to_number(to_char( time_key, 'YYYYMMDD'))
    The result of this expression can be used as input to the cube's time dimension attribute.
    Cheers
    David

  • Creating Time dimension in BW data model. - like seen in logical data model

    Hello all,
    I have been struggling with this thing and I am looking for some help from anyone on this forum.
    We are trying to create a logical data model of our bw system. We are going live next month with Student module for universities. We have multiple Infocubes and DSO and since there is so much crossing over in between them most of the reporting is done on infosets.
    One of the thing we were thinking; is it possible to create something like a common time dimension table for every infoprovider. Basically when we are providing the reports to the end user can we give them a drop down menu which gives a time frame for reporting rather than selecting.
    Example: Like can we create something which looks in the drop down like current month data, last months data, three months ago, four months ago, five months ago, one year ago, two years ago. Can we make like these data slices in our cube and deliver it to the end user?
    We have in our cube a few date infoobjects, like receipt date, decision date, cancellation date and like wise.
    Please let me know if any one has done any similar thing, it will be very helpful.
    Thank you so much in advance.

    if you add your common time dimension to your data model, first identify for each infoprovider the time against which 'current month' and other frames should be applied and map them to your dimension.
    just a question... are you not using time dimension in cubes ? ideally this should be your time dimension llinking all.
    when you use time dimension which uses 'current month' , 'current year' , you will have to address their historisation as well. (because current month now will not be so current after 2 months).
    so in data load procedure every day these values need to change (meaning drop and reload).
    and routines to populate these values based on reporting date.
    Edited by: hemant vyas on May 6, 2009 1:56 PM

  • TIME_DSO_1 attribute in Time Dimension

    Hi,
    We are using Oracle Analytic Workspace Manager version 10.2.0.3.0A for creating a cube.
    We have defined a dimension as "Time" dimension and have also specified the dimension type as "Time".
    This dimension has the levels: Year, Quarter, Month, Week and Day. These levels are for the one and only hierarchy of the Time dimension.
    The attributes of the dimension (applicable to all the levels) are: END_DATE, LONG_DESCRIPTION, SHORT_DESCRIPTION, and TIME_SPAN.
    In this structure, we are having a strange observation : During the process of defining this TIME dimension, there were some problems with the machine (it got hanged) and so we had to exit (kill) the AWM and come in again. When we logged in to AWM again, we could see a new attribute called TIME_DSO_1 defined within the Time dimension by itself.
    Can anyone let us know what is this attribute all about ? And can we go ahead and just delete this from our dimension structure without creating problems for ourselves?
    Many thanks in advance for the kind inputs of the forum.
    Regards,
    Piyush

    Hi,
    I can't say that I really understand how your data shows up, but I do see an error in your hierarchy.
    What you should do is split it up into two hierarchies.
    Year-> Quarter-> Month-> Day
    and
    Year-> Week-> Day
    And here is the reason:
    A day can easily have a week as a parent and month. But week cannot. Since a month can end on any given day in a week, that means that a week can have two parents. If I take the next week as an example. Mon, tue, wed, thu and fri would belong to the august month, while the rest of the week would belong to september. But the entire week would still be week 35. And its the same issue with quarter. Months can be added into a quarter, but weeks can not.
    Now, I'm not sure if this would solve all your problems, but there might be a few other things you might check out and thats what ID's you populate your member fields with.
    say that you have used the month numbers (or at least the same id for every january and so on)to populate your months. If that is the case things will also behave extremely weird and slow. What you need to do is to create unique IDs for every month (and any other level) so that you are sure that january 2007 don't have any child records that really should belong to january 2006.
    As a general rule, the member field needs to contain a completely unique value across on from all levels. The "generate surrogate key" functionality helps you a bit along the way as it adds the name of your level in front of the value that you load. If the values you load doesn't have unique values within the level it won't help you any.
    Hope this can help you some more... ;)
    regards Ragnar

  • OracleBI Spreadsheet Add-in Not Working With ROLAP TIME Dimension

    Hello,
    I've been trying to figure this bizarre behavior for a while now.
    I have created a TIME dimension (based on a relational table) using OEM and defined the metadata etc. My hierarchy has 4 levels: day->month->quarter->year. I have end_date and time_span attributes defined for each level. I have defined a simple cube dimensioned by TIME and having only 1 numeric measure.
    When I open BI Spreadsheet Add-in, I can see my cube measure and the dimension in the list of available entities. I add them to the list of selected entities and hit 'next'. On the next screen I arrange them to my liking and hit 'next' again. This is where the problem occurs. Or rather where nothing occurs. The add-in just gets stuck at this point and no matter what I do or click, it won't advance to the next step.
    If I change the dimension type from time to normal, then everything works as expected (although, I cannot do time-series analysis).
    If I create and enable an analytic workspace and use it in the add-in, then everything works as expected as well.
    Any ideas what's wrong here? I kind of suspect the end_date and time_span attributes are involved somehow...
    Thanks!
    Dobo

    The expected format for a relational time table would be something like the following:
    CREATE TABLE "BIBDEMO"."BIBDEMO_TIME"
    ("TIME_STD_MONTH" VARCHAR2(30),
    "TIME_STD_MONTH_LLABEL" VARCHAR2(60),
    "TIME_STD_MONTH_SLABEL" VARCHAR2(30),
    "TIME_STD_QUARTER" VARCHAR2(30),
    "TIME_STD_QUARTER_LLABEL" VARCHAR2(60),
    "TIME_STD_QUARTER_SLABEL" VARCHAR2(30),
    "TIME_STD_YEAR" VARCHAR2(30),
    "TIME_STD_YEAR_LLABEL" VARCHAR2(60),
    "TIME_STD_YEAR_SLABEL" VARCHAR2(30),
    "TIME_YTD_YEAR" VARCHAR2(30),
    "TIME_YTD_YEAR_LLABEL" VARCHAR2(60),
    "TIME_YTD_YEAR_SLABEL" VARCHAR2(30),
    CONSTRAINT BIBDEMO_TIME_PK PRIMARY KEY("TIME_STD_MONTH")
    ALTER TABLE "BIBDEMO"."BIBDEMO_TIME"
    ADD ("TIME_STD_MONTH_END_DATE" DATE,
    "TIME_STD_QUARTER_END_DATE" DATE,
    "TIME_STD_YEAR_END_DATE" DATE,
    "TIME_YTD_YEAR_END_DATE" DATE) ;
    ALTER TABLE "BIBDEMO"."BIBDEMO_TIME"
    ADD ("TIME_STD_MONTH_TIMESPAN" NUMBER,
    "TIME_STD_QUARTER_TIMESPAN" NUMBER,
    "TIME_STD_YEAR_TIMESPAN" NUMBER,
    "TIME_YTD_YEAR_TIMESPAN" NUMBER) ;
    and the metadata registration script should look something like this:
    -- This script modifies the bibdemo_time lookup table and bibdemo TIME dimension. It adds a period end date attribute.
    ALTER TABLE "BIBDEMO"."BIBDEMO_TIME"
    ADD ("TIME_STD_MONTH_END_DATE" DATE,
    "TIME_STD_QUARTER_END_DATE" DATE,
    "TIME_STD_YEAR_END_DATE" DATE,
    "TIME_YTD_YEAR_END_DATE" DATE) ;
    ALTER TABLE "BIBDEMO"."BIBDEMO_TIME"
    ADD ("TIME_STD_MONTH_TIMESPAN" NUMBER,
    "TIME_STD_QUARTER_TIMESPAN" NUMBER,
    "TIME_STD_YEAR_TIMESPAN" NUMBER,
    "TIME_YTD_YEAR_TIMESPAN" NUMBER) ;
    begin
    dbms_output.put_line('Drop level attributes of TIME prior to recreation.');
    cwm_olap_dim_attribute.remove_level_attribute('BIBDEMO', 'TIME', 'Long Description', 'L1', 'TIME_STD_YEAR_LLABEL');
    cwm_olap_dim_attribute.remove_level_attribute('BIBDEMO', 'TIME', 'Short Description', 'L1', 'TIME_STD_YEAR_SLABEL');
    cwm_olap_dim_attribute.remove_level_attribute('BIBDEMO', 'TIME', 'Long Description', 'L2', 'TIME_STD_QUARTER_LLABEL');
    cwm_olap_dim_attribute.remove_level_attribute('BIBDEMO', 'TIME', 'Short Description', 'L2', 'TIME_STD_QUARTER_SLABEL');
    cwm_olap_dim_attribute.remove_level_attribute('BIBDEMO', 'TIME', 'Long Description', 'L3', 'TIME_STD_MONTH_LLABEL');
    cwm_olap_dim_attribute.remove_level_attribute('BIBDEMO', 'TIME', 'Short Description', 'L3', 'TIME_STD_MONTH_SLABEL');
    cwm_olap_dim_attribute.remove_level_attribute('BIBDEMO', 'TIME', 'Long Description', 'L4', 'TIME_YTD_YEAR_LLABEL');
    cwm_olap_dim_attribute.remove_level_attribute('BIBDEMO', 'TIME', 'Short Description', 'L4', 'TIME_YTD_YEAR_SLABEL');
    commit;
    exception
    when others then
    dbms_output.put_line('ERROR: unexpected exception during seeding');
    cwm_utility.dump_error;
    rollback;
    raise;
    end;
    ALTER DIMENSION BIBDEMO.TIME
    DROP ATTRIBUTE L1
    DROP ATTRIBUTE L2
    DROP ATTRIBUTE L3
    DROP ATTRIBUTE L4;
    ALTER DIMENSION BIBDEMO.TIME
    ADD ATTRIBUTE L1 DETERMINES
    (BIBDEMO_TIME.TIME_STD_YEAR_LLABEL,
    BIBDEMO_TIME.TIME_STD_YEAR_SLABEL,
    BIBDEMO_TIME.TIME_STD_YEAR_END_DATE,
    BIBDEMO_TIME.TIME_STD_YEAR_TIMESPAN)
    ADD ATTRIBUTE L2 DETERMINES
    (BIBDEMO_TIME.TIME_STD_QUARTER_LLABEL,
    BIBDEMO_TIME.TIME_STD_QUARTER_SLABEL,
    BIBDEMO_TIME.TIME_STD_QUARTER_END_DATE,
    BIBDEMO_TIME.TIME_STD_QUARTER_TIMESPAN)
    ADD ATTRIBUTE L3 DETERMINES
    (BIBDEMO_TIME.TIME_STD_MONTH_LLABEL,
    BIBDEMO_TIME.TIME_STD_MONTH_SLABEL,
    BIBDEMO_TIME.TIME_STD_MONTH_END_DATE,
    BIBDEMO_TIME.TIME_STD_MONTH_TIMESPAN)
    ADD ATTRIBUTE L4 DETERMINES
    (BIBDEMO_TIME.TIME_YTD_YEAR_LLABEL,
    BIBDEMO_TIME.TIME_YTD_YEAR_SLABEL,
    BIBDEMO_TIME.TIME_YTD_YEAR_END_DATE,
    BIBDEMO_TIME.TIME_YTD_YEAR_TIMESPAN);
    declare
    timespan_desc_id number;
    enddate_desc_id number;
    TIME_DIM_ATTRIB_TYPE constant varchar2(30) := 'DIMENSION ATTRIBUTE';
    TIME_ATTRIBUTE_TYPE constant varchar2(30) := 'LEVEL ATTRIBUTE';
    begin
    dbms_output.put_line('Create end_date and timespan attributes of TIME for BIBDEMO schema');
    begin
    cwm_olap_level_attribute.set_name('BIBDEMO', 'TIME', 'L1', 'TIME_STD_YEAR_END_DATE', 'TIME_STD_YEAR_END_DATE');
    cwm_olap_level_attribute.set_name('BIBDEMO', 'TIME', 'L2', 'TIME_STD_QUARTER_END_DATE', 'TIME_STD_QUARTER_END_DATE');
    cwm_olap_level_attribute.set_name('BIBDEMO', 'TIME', 'L3', 'TIME_STD_MONTH_END_DATE', 'TIME_STD_MONTH_END_DATE');
    cwm_olap_level_attribute.set_name('BIBDEMO', 'TIME', 'L4', 'TIME_YTD_YEAR_END_DATE', 'TIME_YTD_YEAR_END_DATE');
    cwm_olap_level_attribute.set_name('BIBDEMO', 'TIME', 'L1', 'TIME_STD_YEAR_TIMESPAN', 'TIME_STD_YEAR_TIMESPAN');
    cwm_olap_level_attribute.set_name('BIBDEMO', 'TIME', 'L2', 'TIME_STD_QUARTER_TIMESPAN', 'TIME_STD_QUARTER_TIMESPAN');
    cwm_olap_level_attribute.set_name('BIBDEMO', 'TIME', 'L3', 'TIME_STD_MONTH_TIMESPAN', 'TIME_STD_MONTH_TIMESPAN');
    cwm_olap_level_attribute.set_name('BIBDEMO', 'TIME', 'L4', 'TIME_YTD_YEAR_TIMESPAN', 'TIME_YTD_YEAR_TIMESPAN');
    cwm_olap_dim_attribute.create_dimension_attribute('BIBDEMO', 'TIME', 'End_Date', 'End_Date', 'End Date of time period');
    cwm_olap_dim_attribute.create_dimension_attribute('BIBDEMO', 'TIME', 'Time_Span', 'Time_Span', 'Number of days in time period');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Long Description', 'L1', 'TIME_STD_YEAR_LLABEL');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Short Description', 'L1', 'TIME_STD_YEAR_SLABEL');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'End_Date', 'L1', 'TIME_STD_YEAR_END_DATE');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Time_Span', 'L1', 'TIME_STD_YEAR_TIMESPAN');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Long Description', 'L2', 'TIME_STD_QUARTER_LLABEL');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Short Description', 'L2', 'TIME_STD_QUARTER_SLABEL');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'End_Date', 'L2', 'TIME_STD_QUARTER_END_DATE');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Time_Span', 'L2', 'TIME_STD_QUARTER_TIMESPAN');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Long Description', 'L3', 'TIME_STD_MONTH_LLABEL');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Short Description', 'L3', 'TIME_STD_MONTH_SLABEL');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'End_Date', 'L3', 'TIME_STD_MONTH_END_DATE');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Time_Span', 'L3', 'TIME_STD_MONTH_TIMESPAN');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Long Description', 'L4', 'TIME_YTD_YEAR_LLABEL');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Short Description', 'L4', 'TIME_YTD_YEAR_SLABEL');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'End_Date', 'L4', 'TIME_YTD_YEAR_END_DATE');
    cwm_olap_dim_attribute.add_level_attribute('BIBDEMO', 'TIME', 'Time_Span', 'L4', 'TIME_YTD_YEAR_TIMESPAN');
    begin
    SELECT descriptor_id INTO enddate_desc_id
    FROM all_olap_descriptors
    WHERE descriptor_value = 'End Date'
    AND descriptor_type = 'Time Dimension Attribute Type';
    begin
    dbms_output.put_line('Classify entity descriptor use end date for TIME');
    begin
    cwm_classify.add_entity_descriptor_use(enddate_desc_id, TIME_DIM_ATTRIB_TYPE, 'BIBDEMO', 'TIME', 'End_Date');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    begin
    cwm_classify.add_entity_descriptor_use(enddate_desc_id, TIME_ATTRIBUTE_TYPE, 'BIBDEMO', 'TIME', 'L3', 'TIME_STD_MONTH_END_DATE');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    begin
    cwm_classify.add_entity_descriptor_use(enddate_desc_id, TIME_ATTRIBUTE_TYPE, 'BIBDEMO', 'TIME', 'L2', 'TIME_STD_QUARTER_END_DATE');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    begin
    cwm_classify.add_entity_descriptor_use(enddate_desc_id, TIME_ATTRIBUTE_TYPE, 'BIBDEMO', 'TIME', 'L1', 'TIME_STD_YEAR_END_DATE');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    begin
    cwm_classify.add_entity_descriptor_use(enddate_desc_id, TIME_ATTRIBUTE_TYPE, 'BIBDEMO', 'TIME', 'L4', 'TIME_YTD_YEAR_END_DATE');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    end;
    end;
    begin
    SELECT descriptor_id INTO timespan_desc_id
    FROM all_olap_descriptors
    WHERE descriptor_value = 'Time Span'
    AND descriptor_type = 'Time Dimension Attribute Type';
    begin
    dbms_output.put_line('Classify entity descriptor use time span for TIME');
    begin
    cwm_classify.add_entity_descriptor_use(timespan_desc_id, TIME_DIM_ATTRIB_TYPE, 'BIBDEMO', 'TIME', 'Time_Span');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    begin
    cwm_classify.add_entity_descriptor_use(timespan_desc_id, TIME_ATTRIBUTE_TYPE, 'BIBDEMO', 'TIME', 'L3', 'TIME_STD_MONTH_TIMESPAN');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    begin
    cwm_classify.add_entity_descriptor_use(timespan_desc_id, TIME_ATTRIBUTE_TYPE, 'BIBDEMO', 'TIME', 'L2', 'TIME_STD_QUARTER_TIMESPAN');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    begin
    cwm_classify.add_entity_descriptor_use(timespan_desc_id, TIME_ATTRIBUTE_TYPE, 'BIBDEMO', 'TIME', 'L1', 'TIME_STD_YEAR_TIMESPAN');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    begin
    cwm_classify.add_entity_descriptor_use(timespan_desc_id, TIME_ATTRIBUTE_TYPE, 'BIBDEMO', 'TIME', 'L4', 'TIME_YTD_YEAR_TIMESPAN');
    exception
    when cwm_exceptions.element_already_exists
    then null;
    end;
    end;
    end;
    end;
    commit;
    exception
    when others then
    dbms_output.put_line('ERROR: unexpected exception during seeding');
    cwm_utility.dump_error;
    rollback;
    raise;
    end;
    --UPDATE "BIBDEMO"."BIBDEMO_TIME" SET TIME_STD_MONTH_END_DATE = LAST_DAY(TO_DATE( time_std_month , 'monyy'));
    --UPDATE "BIBDEMO"."BIBDEMO_TIME" t SET TIME_STD_QUARTER_END_DATE = (select max(t1.time_std_month_end_date) from bibdemo_time t1 where t1.time_std_quarter = t.time_std_quarter group by t1.time_std_quarter) ;
    --UPDATE "BIBDEMO"."BIBDEMO_TIME" t SET TIME_STD_YEAR_END_DATE = (select max(t1.time_std_month_end_date) from bibdemo_time t1 where t1.time_std_year = t.time_std_year group by t1.time_std_year) ;
    update bibdemo_time set time_std_month_end_date = to_date('31-JAN-2000', 'dd-mon-yyyy') where time_std_month = 'JAN00';
    update bibdemo_time set time_std_month_end_date = to_date('29-FEB-2000', 'dd-mon-yyyy') where time_std_month = 'FEB00';
    update bibdemo_time set time_std_month_end_date = to_date('31-MAR-2000', 'dd-mon-yyyy') where time_std_month = 'MAR00';
    update bibdemo_time set time_std_month_end_date = to_date('30-APR-2000', 'dd-mon-yyyy') where time_std_month = 'APR00';
    update bibdemo_time set time_std_month_end_date = to_date('31-MAY-2000', 'dd-mon-yyyy') where time_std_month = 'MAY00';
    update bibdemo_time set time_std_month_end_date = to_date('30-JUN-2000', 'dd-mon-yyyy') where time_std_month = 'JUN00';
    update bibdemo_time set time_std_month_end_date = to_date('31-JUL-2000', 'dd-mon-yyyy') where time_std_month = 'JUL00';
    update bibdemo_time set time_std_month_end_date = to_date('31-AUG-2000', 'dd-mon-yyyy') where time_std_month = 'AUG00';
    update bibdemo_time set time_std_month_end_date = to_date('30-SEP-2000', 'dd-mon-yyyy') where time_std_month = 'SEP00';
    update bibdemo_time set time_std_month_end_date = to_date('31-OCT-2000', 'dd-mon-yyyy') where time_std_month = 'OCT00';
    update bibdemo_time set time_std_month_end_date = to_date('30-NOV-2000', 'dd-mon-yyyy') where time_std_month = 'NOV00';
    update bibdemo_time set time_std_month_end_date = to_date('31-DEC-2000', 'dd-mon-yyyy') where time_std_month = 'DEC00';
    update bibdemo_time set time_std_month_end_date = to_date('31-JAN-2001', 'dd-mon-yyyy') where time_std_month = 'JAN01';
    update bibdemo_time set time_std_month_end_date = to_date('28-FEB-2001', 'dd-mon-yyyy') where time_std_month = 'FEB01';
    update bibdemo_time set time_std_month_end_date = to_date('31-MAR-2001', 'dd-mon-yyyy') where time_std_month = 'MAR01';
    update bibdemo_time set time_std_month_end_date = to_date('30-APR-2001', 'dd-mon-yyyy') where time_std_month = 'APR01';
    update bibdemo_time set time_std_month_end_date = to_date('31-MAY-2001', 'dd-mon-yyyy') where time_std_month = 'MAY01';
    update bibdemo_time set time_std_quarter_end_date = to_date('30-JUN-2000', 'dd-mon-yyyy') where time_std_quarter = 'Q2.00';
    update bibdemo_time set time_std_quarter_end_date = to_date('30-SEP-2000', 'dd-mon-yyyy') where time_std_quarter = 'Q3.00';
    update bibdemo_time set time_std_quarter_end_date = to_date('31-DEC-2000', 'dd-mon-yyyy') where time_std_quarter = 'Q4.00';
    update bibdemo_time set time_std_quarter_end_date = to_date('31-MAR-2000', 'dd-mon-yyyy') where time_std_quarter = 'Q1.00';
    update bibdemo_time set time_std_quarter_end_date = to_date('31-MAR-2001', 'dd-mon-yyyy') where time_std_quarter = 'Q1.01';
    update bibdemo_time set time_std_quarter_end_date = to_date('31-MAY-2001', 'dd-mon-yyyy') where time_std_quarter = 'Q2.01';
    update bibdemo_time set time_std_year_end_date = to_date('31-DEC-2000', 'dd-mon-yyyy') where time_std_year = '2000';
    update bibdemo_time set time_std_year_end_date = to_date('31-MAY-2001', 'dd-mon-yyyy') where time_std_year = '2001';
    update bibdemo_time set time_ytd_year_end_date = to_date('31-DEC-2000', 'dd-mon-yyyy') where time_ytd_year = '2000';
    update bibdemo_time set time_ytd_year_end_date = to_date('31-MAY-2001', 'dd-mon-yyyy') where time_ytd_year = '2001';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'JAN00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 29 where "TIME_STD_MONTH" = 'FEB00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'MAR00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 30 where "TIME_STD_MONTH" = 'APR00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'MAY00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 30 where "TIME_STD_MONTH" = 'JUN00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'JUL00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'AUG00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 30 where "TIME_STD_MONTH" = 'SEP00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'OCT00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 30 where "TIME_STD_MONTH" = 'NOV00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'DEC00';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'JAN01';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 28 where "TIME_STD_MONTH" = 'FEB01';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'MAR01';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 30 where "TIME_STD_MONTH" = 'APR01';
    update "BIBDEMO"."BIBDEMO_TIME" set "TIME_STD_MONTH_TIMESPAN" = 31 where "TIME_STD_MONTH" = 'MAY01';
    update "BIBDEMO"."BIBDEMO_TIME" t
    set "TIME_STD_QUARTER_TIMESPAN" = (
    select sum(t1.time_std_month_timespan)
    from bibdemo_time t1
    where t."TIME_STD_QUARTER" = t1.time_std_quarter
    group by t1.time_std_quarter
    update "BIBDEMO"."BIBDEMO_TIME" t
    set "TIME_STD_YEAR_TIMESPAN" = (
    select sum(t1.time_std_month_timespan)
    from bibdemo_time t1
    where t."TIME_STD_YEAR" = t1.time_std_year
    group by t1.time_std_year
    update "BIBDEMO"."BIBDEMO_TIME" t
    set "TIME_YTD_YEAR_TIMESPAN" = (
    select sum(t1.time_std_month_timespan)
    from bibdemo_time t1
    where t."TIME_YTD_YEAR" = t1.time_ytd_year
    group by t1.time_ytd_year
    commit;
    quit;
    Hope this helps
    Business Intelligence Beans Product Management Team
    Oracle Corporation

  • OLAP time dimension - how are the weeks allocated

    Could someone please help me understand what logic Oracle uses when one makes use of Oracles OLAP time dimension based on weeks.
    I am use Oracle OLAP 11.2
    I have a Time dimension that has the following hierarchy:-
    YEAR
    QUARTER
    MONTH
    WEEK
    For calculating the weeks ID I make use ISO week and year i.e. IYYYIW
    For calculating the end date I use the following:- NEXT_DAY( l_date, 'MON' ) -1
    i.e. the weeks end date is the Sunday.
    According to me this is the required result.
    Problem is that for some months there are 3 weeks allocated which makes no sense to me.
    I cannot understand the logic used in allocating the weeks.
    The following is an example:-
    the following weeks were allocated to the month February
    201306 (end date= 10-2-2013)
    201307 (end date= 17-2-2013)
    201308 (end date= 24-2-2013)
    but the following week was allocated to January which makes no sence to me,
    I would have expected it to be found in February
    201305 (end date= 3-2-2013)
    Week 201309 (end date= 3-3-2013) was allocated to March which according to me is correct..
    Another example is week *201030 (end date= 1-8-2010)* that is allocated to July while I would have expected that it should be August.
    I would have thought that it uses the end date that is placed in the mapping to determine the month to place it in.
    Could some one please explain what the reason for this could be.

    Oracle OLAP model/design (in this case, at least) cannot compensate to coverup existing flaws in the relational model/design.
    I dont think this is a valid hierarchy even considering relational model/design.
    Weeks do not fit in below Months (calendar months).
    You can force fit them by making Weeks the source of truth and making all Months logical Months like "Business Month", "Business Quarter", "Business Year" etc. which will be composed of whole weeks but differ significantly from the calendar definition of Month, Quarter, Year etc.
    You are better off modeling time as composed of two hierarchies:
    H1: DAY -> MONTH -> QUARTER -> YEAR and
    H2: DAY -> WEEK
    Alternately if you dont want to introduce DAY level (lower granularity), you can split up the Time dimension into 2 different dimensions. And also modify your star schema to add an additional time dimension key to fact table - one key pointing to WEEK and another pointing to MONTH (independently).
    TIME_MO: MONTH -> QUARTER -> YEAR
    TIME_WK: WEEK
    The fact data will need to be split up to correctly identify the coirrect MONTH-WEEK combination for the relational record.
    E.g:
    Fact table should have 2 dimension Fks for WK_KEY as well as MO_KEY so that a fact figure of 1000 evaluated over 7 days is split up into 300 from 29-31st of previous month and attached to MO_KEY of previous month and another record of 700 covering days from 1-4 and recorded/tied to same WK_KEY but next month (next month's MO_KEY).
    HTH
    Shankar

Maybe you are looking for

  • Two user accounts after using migration assistant

    I used migration assistant to move my iTunes library (plus all my other files) from my iMac to my macbook. I wanted to sync my iPhone on my Macbook. I didn't think it had worked but I shut down my macbook and noticed I have two user ID's now (identic

  • Errors with JDK1.4 and IS 5.1

    has anyone experienced problems using JDK1.4 with IS 5.1 and AM SDK ? I get JSS errors Key is null appears to be problems with the org.mozilla.jss packages do they need to be updated to a newer release for jdk14 ? i tried renaming the jss311.jar.jdk1

  • Ratings removed from songs 20 minutes after setting

    I spent an hour going through 200 songs on my iTunes library, starring them and putting them in playlists. Twenty minutes later I noticed they were all gone, as if I didn't touch a thing. Playlist information has gone, ratings have gone, and a select

  • Correct OCCI connection String

    Hi, I trying to write some small application on a 32bit Centos machine, with g++ and OCCI, I have correctly setup the library linking and have some sample code running alright, however I don't seem to be able to get a correct connection string to con

  • Message: No additional applications designed for your device were found

    I'm trying to add a program onto my blackberry Pearl using Desktop manager & I get the message: No additional applications designed for your device were found.  Help!  Thanks in advance! - Lola