Composite key in Time dimension

Hi All,
I would like to know Time dimension with Composite key. I have a requirement where I want to store 2 Calendars in Time dimension table. for e.g :
for one calendar Weekstarts from SUN-SAT and for another it is from MON-TUE
DateKey   Type WeekStart   WeekEnd
20140101   1       Sun               Sat      
20140101   2       Mon               Tue
..................etc
I have a measure group which is related to Time dimension (DateKey and Type used a Composite key). This implementation has no issues for additive measures but there are few issues with semi-additive measures (last non-empty,...).
Will composite Key have any effect on semi-additive measures ?
what if i use surrogate key instead of composite key.
Please suggest if the approach has any issue with Time intelligence. Advise if there is any better approach for the same.
Ram MSBI Developer

Hey.. Thanks!
I am clear about the concept about defining annotation based composite key. Also, I read in the documentation that I'll be needing to define as direct, aggregate or one-to-one. But, I am not able to define and run the same in the project mapping xml of toplink.
It would be great if you can share some sample code for defining the same. For e.g. in my mentioned example, there is TestEntity POJO having 'id' as the attribute which gets populated with the testEntityCode of the TestEntityKey POJO. Please suggest the same for the same:
<opm:primary-key>
<opm:attribute-name>id</opm:attribute-name>
<opm:field table="TEST_ENTITY_B" name="TEST_ENT_CODE" xsi:type="opm:column"/>
</opm:primary-key>
Thanks!

Similar Messages

  • Primary Key and Chronological Key for Time Dimension

    Could someone please shed light whether it's better to use normal PK or Calendar Date (which is a chronological key on the most detailed level). I tried both and haven't noticed any difference. But my understanding is that I still need to have the PK key on the most detailed level in time hierarchy.
    Thanks

    Matt,
    the PK of the Time Dimension is a regular sequence numeric key. I have it defined as a logical PK for the dimension. However, I guess I was talking about hierarchy key. I tested it either way and the query time is the same. So I guess it doesn't really matter.
    --------Year
    Year (chronological key and primary key)
    ------------------Quarter
    Quarter (key)
    Quarter+Year (primary key, chronological key)
    ---------------------------------Day Detail
    PK (key)
    Date (primary key , chronological key)
    I hope it makes sense.

  • 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

  • Primary Key Data type in Time Dimension????

    I have to create a Time dimension with day grain in a Datawarehouse system and I don’t know what is the best data type for the primary key...
    For example
    1) I could put Number(8) datatype, then the dates will be: 20050114, 20050115, 20050116.... Then in the fact tables I put the Number(8) datatype in the date fields... But in my reporting tools I have to put the to_date function to show the dates in the right format.
    2) Or I could put Date datatype, then the dates will be: 01/14/2005, 01/15/2005, 01/16/2005.... Then in the fact tables I put the Date datatype in the date fields...
    It’s the Date primary key a bad datatype? (Very slow)
    What is the best Primary Key Data type in Time Dimension???
    Thanks!

    <quote>I have to create a Time dimension with day grain</quote>
    OK.
    <quote>But in my reporting tools I have to put the to_date function to show the dates in the right format</quote>
    Why? ... if you’ve decided to have a Day dimension table what is stopping you from having the day represented as a DATE column in there? (plus all the other "right formats" you may need). The join keys should only be used for … joining.
    <quote> It’s the Date primary key a bad datatype? (Very slow)</quote>
    No … DATE or NUMBER won’t make any noticeable difference when used as the join key between the time dimension and the fact table.
    Some see advantages in having the DATE FK in the fact table …
    1. One can have range partitioning in the fact using real DATEs
    2. One can get Day-derived info right from the fact table … that is, the join to the Day dimension is not needed
    I don’t (see them as advantages) … for #1, range partitioning by some measure of time is still achievable as long as the PK values on the Day dimension are immutable (as they should) … and I don’t see #2 as an advantage for the DW end-users.
    Personally, I prefer a surrogate numeric PK … but not things like 20050129.
    <William>If you need dates then use dates. They are more robust, you can never accidentally have November 43rd</William>
    Of course this can not be about the fact table … since there the column is constrained … so this is about accidentally getting "November 43rd, 2004" into the Day dimensions when the PK is numeric 20041143; true, but is a DATE PK more robust in this case? … No … one could accidentally insert to_date('29-Jan-2005','DD-Mon-YYYY') and to_date('29-Jan-2005 00:00:01','DD-Mon-YYYY HH24:MI:SS') and that won't be very good, would it? In both cases, one would need something extra to 100% protect the integrity of the Day dimension (mind you, loading the Day dimension probably happens once a year under the supervision of the most technical people on the project).
    There is no best PK data type for the Day dimension (between NUMBER and DATE) … they are both workable solutions ... go with what you’re comfortable.

  • Time dimension and chronological key

    HI ALL
    I WORK ON OBIEE 11G REPORTS
    WHAT IS THE EXACT USE OF TIME CHECK BOX AND CHRONOLOGICAL KEY??
    AND HOW CAN I USE IT
    ANY HELP ??

    Hi,
    What is the chronological key use?
    A. Typically time dimension differs from all other dimensions in one way and that is,
    all other dimensions dont care about the order of the values in it.
    e.g. in region_dim the values are north, south, west and east. Here nobody wants to see whether north comes first or south comes first. i.e. no order is required here.
    in the case of time dimension there needs to be a particular order for all the values present in it.
    e.g. 2010 is earliest and 2004 is older. Dec-10 is earliest and jan-10 is older. i.e. the values in the time dimensiion needs to follow a particular sorting order. So the chronological key is the key which tells the obiee that the data is incrementing based on the chronological column.
    Here you may get another doubt. i.e. you are having columns like year, half_year, quarter, month, week and day. Here which one should become the chronolgocial key?
    Analyse it yourself. If you kept year as chro key then obiee will be confused whether jan-10 is earliest or feb-10 is earliest. Because it knows only that 2010 is earliest and 2009 is older.
    So always it should be the lowest level oif the dimension which needs to be the chronological key. In the abouve case it should be date.
    You can select either date or date_id(this could be a sequence generator values).
    2. what is the use time dimension?
    A.If all you want is to achieve drills from Month, Quarter and Year then treat it as a normal dimension and create the levels. But if you want to do calculations like YTD, QTD and MTD then you need to create a time dimension.
    http://oraclebizint.wordpress.com/2007/11/05/oracle-bi-ee-101332-understanding-todate-and-ago-achieving-ytd-qtd-and-mtd/
    Refer the above link for time dimension.
    Award points it is useful.
    Thanks
    satya
    Edited by: Satya Ranki Reddy on May 2, 2012 12:29 AM

  • How does composite key work in loading SCD dimension ?

    Hi.
    I have the following DB configuration in Source:-
    id number (PK)
    id_version number (PK)
    name varchar2(255)
    and following DB configuration in TRGT:-
    row_id number (SK)
    d_id number (NK)
    d_name varchar2(255)
    Following are the ODI Mappings for TRGT:-
    row_id number (SK) (ins, trgt)
    d_id number (NK) (ins, trgt)
    d_name varchar2(255) (ins/upd, trgt)
    How do I take care in loading this type2 SCD load? It gives me error in creating unique index. As partial key i.e. id_version is not taken care of.
    How do i define composite keys in this case?

    Thanks Chris!
    Made my day a lot easier
    // Erik

  • Advice needed: join fact to time dimension with between clause

    Hi All,
    I've got 1 dimension and two fact tables. The 1 dimension could serve as a time dimension.(not specifically marked as this is a time dimension)
    My Tables look like this (simplified)
    Dim1:
    date_pk (unique identifier)
    date
    month
    year
    fact1:
    iid_date (foreign key to date_pk)
    fact1_amount
    Fact2:
    begin_date
    end_date
    fact2_amount
    In the physical layer i have a complex join between fact 1 and dim1 (date_pk = idd_date) and a complex join between fact2 and dim1 (dim1.date between fact2.begin_date and fact2.end_date and dim1.date <= CURRENT_DATE). In the business model i have complex joins between fact1 and dim1 and a complex join between fact2 and dim1 without further specification.
    What I would like to achieve in Answers is that I select a Year and a Month from dim1 and add fact1_amount and fact2_amount to the same report and that the report shows both amounts. I would like some advice on how to set this up. Further more how to add a drill from year to month to date and what should I do when I'm willing to add more facts joined to the same Dim1
    Any Advice is greatly appreciated
    Gilles

    Hello MMA1709,
    You're right, this setup works!
    But...
    When you add an hierarchy and mark it as a time dimension it doesn't work anymore. It gives the following error in the consistency checker:
    [38086] Physical table Dim1 in the time dimenison table source Dim1 is part of a complex join condition
    And that means you cannot use any timebased calculations (AGO and TODATE). When I just create an hierarchy and do not mark it as a time dimension the hierarchy works well.
    Any suggestions?

  • Date and Time dimensions

    After reading the following article, I have decided to use SSAS dimension wizard for generating our Date dimension, which creates a DATETIME PK.
    http://www.made2mentor.com/2011/05/date-vs-integer-datatypes-as-primary-key-for-date-dimensions/ 
    I have also created a separate Time dimension as granularity of an hour is required.
    The Time dimension is very simple and only contains a surrogate key (INTEGER) and actual time in hours (VARCHAR).
    DimTime(TimeKey, TimeInHours)
    Our Fact table will now have a link to both the Date and Time dimension using the PK's.
    Our analysis is required by hour, day, week, month and year.
    My query is; Will this current structure cause any problems when creating MDX scripts to analyse our data (i.e. drilldown and rollup queries) Hour - Day - Week - Month - Year

    Hi Darren,
    According to your description, there a day and hour granularity in your fact table, so you want to a hierarchy like Hour - Day - Week - Month - Year, right?
    In your scenario, you created a time table that only contains a surrogate key (INTEGER) and actual time in hours (VARCHAR). We cannot create a Hour - Day - Week - Month - Year hierarchy without ant relationship between date table and time table. As per my understanding,
    you need create a foreigner key in time table, and join those table in the data source view, then you can create such a hierarchy. Here are some links about create time dimension, please see:
    http://www.ssas-info.com/analysis-services-articles/59-time-dimension/1224-date-and-time-dimensions-template
    http://www.codeproject.com/Articles/25852/Creating-Time-Dimension-in-Microsoft-Analysis-Serv
    Regards,
    Charlie Liao
    TechNet Community Support

  • Time Dimensions and Logical dimension "..that not join to any fact source"

    Hi Guys,
    I get the following error on the ANSWERS front end:
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14026] Unable to navigate requested expression: ToDate(SPECIFICG:[DAggr(RFACT.SPECIFIC [ ] by [ EFact.NO [ ] , Year.ID [ ] ] )], [Level Years]). Please fix the metadata consistency warnings. (HY000)
    SQL Issued: SELECT EFact.NO saw_0, Fact.YTD_E saw_1, EFact.MTD_E saw_2 FROM "E#1" ORDER BY saw_0
    The consistency manager shows no errors and the tables are physically joined up via foreign key i.e.
    fact year monthday
    data - date - date
    year month
    day
    [see screen print|www.metallon.org/test/foreign.jpg]
    I would be thankfull for any suggestions!

    Hello wildmight.
    I followed this tutorial:
    http://www.rittmanmead.com/2007/04/30/obi-ee-time-dimensions-and-time-series-calculations/
    Why should this layout not work?
    Do you have a better idea?
    When you say "it has to be one table" do you mean
    that quartermonthday and year need to be ONE?
    I just rememered that Oracle Hyperion Planning has to have
    time and months seperated.
    Hello mod100.
    What do you mean hierachy over the time dimension?
    Is it not obvious from the screen print that I have a hierachy
    i.e. yeartotal - years and
    quarters - months- days.
    I read that by default the LEVELS are set to the lowerst. so thats fine. I set them by myself to the lowest as well but the ERROR is still the same.
    no, I have not set the levels as in
    http://obiee-tips.blogspot.com/2009/10/logical-levels.html

  • Setup time dimension in some different fiscal calendars

    I have the different fiscal calendars.
    Then, I wanna compare the current month fiscal amount and the previous month fiscal amount with AGO function.
    The calendars are like below.
    Calendar A : fiscal month start April
    Calendar B : fiscal month start January
    In this case, how should I define the chronological key in the time dimension?
    For example, I try the below setup in the calendar period hierarchy.
    Year 2008
    Half 1H 2H
    Quarter 1Q 2Q 3Q 4Q
    Month 1Q = {Apr-08 in CAL_A, May-08 in CAL_A, Jul-08 in CAL_A, Jan-08 in CAL_B, Feb-08 in CAL_B, Mar-08 in CAL_B}
    and some.
    In this examle, the number of MONTH level members are 24.
    Then I make a column for sort.
    The sort number is below.
    For CAL_A
    Month SortNo.
    Apr-08 1
    May-08 2
    Jun-08 3
    Jul-08 4
    Aug-08 5
    Sep-08 6
    Oct-08 7
    Nor-08 8
    Dec-08 9
    Jan-09 10
    Feb-09 11
    Mar-09 12
    For CAL_B
    Month SortNo.
    Jan-09 13
    Feb-09 14
    Mar-09 15
    Apr-08 16
    May-08 17
    Jun-08 18
    Jul-08 19
    Aug-08 20
    Sep-08 21
    Oct-08 22
    Nor-08 23
    Dec-08 24
    In this case, if I try to get the previous month of Jan-09 in CAL_B with AGO function, the system get Mar-09 for CAL_A. Because the record of Mar-09 for CAL_A is 12 in SortNo. column.
    As far as possible, I wanna use AGO function.
    Does anyone have good ider for this problem?
    Edited by: user3532462 on 2008/08/28 2:57

    Hi,
    I guess it's easier to setup two different time dimensions; one for calendar A and one for calendar B. Use aliases in the Physical Layer.
    Good Luck,
    Daan Bakboord

  • Modifying Existing Time Dimension

    Hi All,
    Presently I have a Time Dimension and a Fact table which has a FK to this Dimension. The Time Dim has a level upto hourly values.
    Now it's in production and I need to change the Time Dim to take on minutes 'cause some reports need minutes.
    1. So what is the best way to go about this?
    2. Is it better just to add another extra field which has the required date, in the fact table?
    3. How can the existing data be easily ported to the new Time Dim(if it has a minute-level)?
    Thanks,
    Justin.

    I am wondering how you implemented the time dimension which only has a level up to hourly values. Do you mean the time dimension only has 24+1 = 25 rows? Usually the time dimension is separate from the date dimension and its lowest level values are minutes or seconds, depending on the business requirements. Therefore the time dimension should have 24X60 + 1 or 24X60X60 +1 rows.
    The solution is depended on what you want.
    My suggestion is as the follows:
    1.     Create a new time dimension with the desired lowest level values (minutes or seconds).
    2.     Create or modify the foreign key of the fact table to point the new created time dimension.
    3.     Modify the ETL mappings.
    4.     Option 1: If you want the new functionality available for the existing rows in the fact, you have to reload the fact no matter which approach you use.
    Option 2: If you only want the new functionality available for the subsequent refresh load, you can modify the foreign-key values pointing to the old time dimension to the new time dimension, using the rule XX --> XX:00 or XX --> XX:00:00 (where XX is the hour number in the old dimension). In the subsequent refresh load, map the foreign-key values to the actual time.
    Maybe other else can provide better solutions. IF so, please let me know.
    Good luck!

  • Using time dimension in materialized view

    Do anybody has an example of using Time dimension in MVIEW?. The time tablke has no relation with oder object (ex. i will join the time table with sales table, which has no relation with each other.
    Thanks in advance
    Mehdi

    Hi
    Check the foreign key on the fact table to see how it is related to the time dimension table.
    Cheers
    David

  • Setting up a TIME dimension in OBIEE

    Hi,
    We have an Oracle OLAP Cube built using AWM v10.2.0.3A. We have also created a relational view for this cube (using the OLAP view generator) and are now using this view as a data source in OBIEE v.10.1.3.3.2.
    As part of defining the Time dimension in the Business Model Layer of OBIEE repository, we have done all the relevant mappings to the TIME dimension as in the AWM Cube and have marked the dimension as type 'TIME'. Also, for the TIME logical table, we have defined each level (All Years, Year, Month, Quarter, and Day) to have its own chronological key with unique values at all levels. The primary key for our TIME table in the business layer is 'Day'. This level 'Day' is mapped to TIME_DAY_LVLDSC column of the relational view created over the AWM cube. The data type for this column is "VARCHAR". (We basically picked up all the 'Description' columns while creating the view over the cube!)
    With this background of the TIME dimension structure, here is the problem scenario:
    When we try to create a report with one AGO and one TODATE function defined over the "Day" level (both are defined as logical columns), then the report takes forever to run and never comes back with any data/error even for a handful of rows. We are seeking the forum's help on the following:
    1. Is it necessary for the primary key 'Day' of the TIME logical table to be of type DATE? If yes, does this mean that we have to change the column data type in our cube (or select a 'date' type column to be a part of the view and then redo the mapping in the repository) or do we just make a change to the column data type in the physical layer of OBIEE repository?
    2. Going by the description above, is there something missing (other than point 1. above) in the setup of the TIME dimension in OBIEE so as to make it usable for Time Series type of calculations/functions?
    Any help is much appreciated.
    Thanks and Regards,
    Piyush

    Hi Wildmight,
    Thanks a lot for your kind inputs.
    1. No, VARCHAR is fine. You should have also defined unique time keys in your time dimension (Quarter Year, Month Year) and check box 'time dimension' in the properties of your time dimension.
    -->> The Time dimension that we have defined in the Business layer of the repository is mapped to the respective level columns in the AWM cube and has already got unique members at each level. We are using the "Description (LVLDSC)" columns for each level and have defined the "Description" column to have unique values at each level. A sample data set looks like :
    Year:
    2007
    2008
    Quarter:
    QUARTER1 2007
    QUARTER2 2007
    QUARTER1 2008
    QUARTER2 2008
    Month:
    JANUARY 2007
    FEBRUARY 2007
    JANUARY 2008
    FEBRUARY 2008
    Day:
    Monday, January 1st 2007
    Tuesday, January 2nd 2007
    So in the above case, do we still need to define a unique key for each level like Quarter Year, Month Quarter, etc.? (Please note that the check box for 'TIME' dimension is checked !)
    2. Is your AGO based on TODATE? or your TODATE based on AGO?
    -->> I am not sure what this really means - however I can tell you that we have created two new logical columns (in the fact table in Business Layer) : one to show the measure as TODATE for Day level, and the other to show the measure as Day Ago.
    So it means that we are trying to create two reports with three columns as below:
    - Day     Measure on Day     Measure Todate (Day)
    - Day     Measure on Day     Measure Day Ago (Day, 1)
    I hope I have been able to clarify the problem scenario with this. Does this setup seem correct to you?
    Many thanks for your help.
    Best Regards,
    Piyush

  • Problem with drill down in time dimension - OBIEE 11G

    Hello There,
    I have a problem with drill down in time dimension. The hierarchy for time dimension is " Fiscal Year---> Fiscal Quarter---> Month(Name)--->Date". When I select a Time dimension and click results its getting opened in a Pivot table view. The problem here is, when I click the "Total" its getting drilled down to Year ---> Quarter but when I click on "+ sign next to quarter" it should drill down to month for that particular quarter for that particular year but its drilling down to month for that particular quarter for all years.
    Any suggestions are much appreciated.
    Thanks,
    Harry.

    1.) Congrats for resurrecting a year-old thread.
    2.) Your answer is here: "Check the level key of the quarter level...it should include both quarter and year columns. Since a specific quarter occurs every year, quarter column alone can't be used as the level key."

  • Problem with time dimension aggregation

    I have a time dimension with 2 columns:Year and week
    I've created a hierarchy in it to drill down from the year to the week.
    when I report the sales in week level I have the right values but when I report the sales value in year level I don't have the right aggregation.Even if the year Level is a grand Total in the hierarchy.
    The problem is that for all the years I have the same value but when I add the week level to the report Then I have the right values.
    What could be the problem

    Hi,
    1.Actually the drill down Route path is not properly generated with your given key columns in herarchies.
    need to give correct key columns
    like year(YYYY)-->Week(wee should be the unique column for each and evry year)
    suppose:
    2000-sunday
    2001-sunday should be different
    so mostly the problem at your week column make the unique yearweek column as the key identifier at that level
    Every Week is unique cause the logical key is a combination of the year and the weeknumber
    2.if not you need to set individual levels for measures in content tab...
    you mean by the content tab the level tab when you doubleclick into the measure???
    Thanks

Maybe you are looking for

  • CS4 Master Collection will not install

    This issue has not been resolved since 9/3. I have already called tech support and they concluded that the problem might arise from a corrupted disc, and sent me a set of replacement discs. This is not resolving the issue. Has anyone ever had an issu

  • Lock Screen In MBP

    I need to know how to lock my screen on my MBP. I want to do it kind of the same way you do in windows. ctrlAlt+DelEnter. how do I do this on the Mac? Thank you, Jason.

  • Communicate between two differente JavaFX desktop design file

    I have created two JavaFX desktop design file with netbeans 6.9.1. One is the login and the other de principal menu. In java i create a object of the principal menu an just call object.setVisible(true). So in javafx how to call the menu principal fro

  • What is Field Label ? and  where do we use it .

    What is Field Label ? and  where do we use it .

  • Update from 8.1.2 to 9.2 not possible

    Hi my mac runs Lion and iphoto 2009. I'm trying to but from the Mac App Store the new iphoto 11 but the computer says: "Unable to verify the distribution of the product as it can be damaged or has not been signed" Please, helpme