Discoverer Condition on Time Dimension table

Hi,
We have a time dimension table TIME_DIM like this:
DATE_ID, YEAR, QUARTER, MONTH, WEEK, DAY
1, 2005, 1, 1, 1, '01-JAN-2005'
2, 2005, 1, 1, 2, '02-JAN-2005'
3, 2005, 1, 1, 2, '03-JAN-2005'
4, 2005, 1, 1, 2, '04-JAN-2005'
5, 2005, 1, 1, 2, '05-JAN-2005'
6, 2005, 1, 1, 2, '06-JAN-2005'
7, 2005, 1, 1, 2, '07-JAN-2005'
8, 2005, 1, 1, 2, '08-JAN-2005'
9, 2005, 1, 1, 3, '09-JAN-2005'
10, 2005, 1, 1, 3, '10-JAN-2005'
The week starts from a sunday and there are 52 weeks in a year. So, in 2005,
Week 52 will have all th days starting Dec-18 till Dec-31.
DATE_ID, YEAR, QUARTER, MONTH, WEEK, DAY
352, 2005, 4, 12, 52, '18-DEC-2005'
353, 2005, 4, 12, 52, '19-DEC-2005'
354, 2005, 4, 12, 52, '20-DEC-2005'
355, 2005, 4, 12, 52, '21-DEC-2005'
356, 2005, 4, 12, 52, '22-DEC-2005'
357, 2005, 4, 12, 52, '23-DEC-2005'
358, 2005, 4, 12, 52, '24-DEC-2005'
359, 2005, 4, 12, 52, '25-DEC-2005'
360, 2005, 4, 12, 52, '26-DEC-2005'
361, 2005, 4, 12, 52, '27-DEC-2005'
362, 2005, 4, 12, 52, '28-DEC-2005'
363, 2005, 4, 12, 52, '29-DEC-2005'
364, 2005, 4, 12, 52, '30-DEC-2005'
365, 2005, 4, 12, 52, '31-DEC-2005'
The condition we would like to have defined is as follows:
Last week(Or Previous Week)
If today is Jan-10, 2005. Current week number is 3 and hence Previous week is 2. So, i should get a condition as follows:
DATE_ID in (Select Date_ID from TIME_DIM where week=(select week - 1 from TIME_DIM where day = sysdate))
Discoverer does not allow subqueries in conditions. How to implement this?
Any help will be appreciated.
The problem is similar to accounting periods that do not correspond to the Gregorian calendar. For gregorian calendar, we can use the date functions to acheive the functionality.
Regards,
Ramesh

The best soultion would probably be to create a database function and register it through Discoverer Administration edition. You can then call the funciton in your condition, to replace the need for a sub-query

Similar Messages

  • Create time dimension table in repository without data warehouse

    Hi,
    I want to implement only BI repository solution in my customer (not datawarehousing). Is it possible to transform the data by repository tools, so that the times columns in fact tables are categorized by the "time dimension" table?
    To be more explanatory:
    The "Sales" table has the "time of sale" column. It contains the timestamp when the sale was performed. I have imported this table in "physical layer" of the repository. Now I want to create a new "time dimension" table, something like:
    CREATE TABLE dimension_time (
    Day_Key INT NOT NULL PRIMARY KEY,
    Day_Timestamp DATETIME NOT NULL,
    Day_Name NVARCHAR(32) NOT NULL,
    Day_Text NVARCHAR(32) NOT NULL,
    INSERT INTO dimension_time VALUES (20110101, {d '2011-01-01'}, '1/1', 'January 1', 'Saturday', 0, 6, 1, 1, 185, 1, 201052, 'W52', 'Week 52', 52, 201101, '01', 'January', 1, 7, 1004, 'Winter', 'Winter', 20111, 'Q1', '1st Quarter', 1, 20103, 'Q3', '3rd Quarter', 3, 20111, 'S1', '1st Semester', 1, 20102, 'S2', '2nd Semester', 2, 2011, '2011', '2011', 2010, '10/11', '2010/2011', 0);
    INSERT INTO dimension_time VALUES (20110102, {d '2011-01-02'}, '2/1', 'January 2', 'Sunday', 0, 7, 2, 2, 186, 2, 201052, 'W52', 'Week 52', 52, 201101, '01', 'January', 1, 7, 1004, 'Winter', 'Winter', 20111, 'Q1', '1st Quarter', 1, 20103, 'Q3', '3rd Quarter', 3, 20111, 'S1', '1st Semester', 1, 20102, 'S2', '2nd Semester', 2, 2011, '2011', '2011', 2010, '10/11', '2010/2011', 0);
    and after to add a new column in "sales" fact table for "time dimension ID" and through the repository populate this column based on the "time of sale" column and the corresponding "time dimension ID".
    I know that the ETL process might perform it, but I do not want to go for Data Warehousing (it is not real - time, needs more resources, etc).
    Is it possible to perform such action only on repository?
    Thank you.

    Hi,
    I can do it, but this would be usefull only to create "time dimension" table. But also the "sales" fact table needs to be altered (thus, the "time" column will not contain the value of the time, but the ID of the corresponding time in the "time dimension" table).
    I know that on DW this procedure is done automatically by the ETL process.
    My question is that does the repository has any tools similar to this?
    Thank you.

  • 10g -  Most detailed table in the time dimension table source is not unique

    hi, experts,
    I cannot find any solution from google. please help
    ERRORS:
    BUSINESS MODEL ERP:
    [38093] Most detailed table in the time dimension table source 'ERP_YEAR_MONTH' is not unique.

    Hi Forreging,
    the time key is incorrectly specified at the lowest level. In the 'ERP_YEAR_MONTH' table, have you correctly specified the primary key for the table?
    For example, if the lowest level of granularity is MONTH, then the appropriate key is probably a combination of YEAR and MONTH (not simply MONTH).
    Hope this helps,
    Justin

  • ERROR while loading time dimension table

    i need to load time dimension from csv to oracle table, while loading i got the error.
    my source data type is date and target is date.
    ODI-1226: Step sample day fails after 1 attempt(s).
    ODI-1240: Flow sample day fails while performing a Loading operation. This flow loads target table W_SAMPLE_DATE.
    ODI-1228: Task SrcSet0 (Loading) fails on the target ORACLE connection Target_Oracle.
    Caused By: java.sql.SQLException: ORA-30088: datetime/interval precision is out of range
    while creating c$ table
    create table WORKSCHEMA.C$_0W_SAMPLE_DATE
         C3_ROW_WID     NUMBER(10) NULL,
         C1_CALENDAR_DATE     TIMESTAMP() NULL,
         C2_DAY_DT     TIMESTAMP() NULL
    )

    check the source data and use the correct function eg TO_DATE(SRC.DATE, 'MM?DD/YYYY') use NVL if required.

  • PER/HR Module - Time Dimension Table

    Hi,
    I am new to financials and am currently running some HR reports against the PER tables. Is there any time/period table equivalent to a time dimension containing:
    -Year
    -Quarter
    - Month
    - Date
    A table similar to GL_PERIODS containing time elements but in the PER module?
    Thanks

    Why do you need a separate table? You can use GL_DATE_PERIOD_MAP.
    Sandeep Gandhi

  • Multiple Date Fields (Fact Table) - Linking with Time Dimension

    I have a fact table that has multiple date columns.
    I can make a time dimension, but it has to be joined to a particular date column. This becomes difficult because of the limit in having multiple date fields reference one time dimension. I can see possibly
    creating a date table which contains all dates, link to fact as well as time dimension table. I am trying to better visualize the table layout on this one. Or are there possibily better ways of looking at this senerio
    Any idea's

    Figured this one out; going to use one time dimension - what looking too much into the details in regard to this scenerio

  • Fiscal Year Time Dimension - Month Time Span

    I have a need to create a fiscal year time dimension and I created using Time Wizard in OWB. When I was developing BI Reports, I found some inconsistencies in Time dimension as it was showing figures in all the months of my first quarter of new financial year that Apr 2009 – Mar 2010. On close inspection of Time Dimension table I found that fiscal_month_time_span value varies from 35 to 28 to 29 for different months. i.e. it’s not matching with corresponding Calendar month. This means I am unable to plot data correctly using fiscal year dimension.
    Maybe this is how it works in Oracle, but this does not solve my problem. Could anyone give me some solution for this ? My Fiscal year is from ‘1- Apr – 09’ to ’31-Mar-10’. In my reports I would like to see transactions for April month when I use month attribute of time dimension like it happens in Calendar time dimension.

    May be someone from
    Forum: Business Intelligence Suite Enterprise Edition can answer this .
    Please post it there.

  • 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

  • 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

  • Time dimension generated differently in 11gR2

    Hi,
    on generating a new default time dimension, I noticed some strange behaviour compared to the former release which seems to be incorrect.
    1. No DIMENSION_KEY column as PK
    2. the %_START_DATE columns are defined as business key instead of the %_NUMBER ord %_CODE columns
    3. DAY_START_DATE is defined as PK column
    I can modify this manually but what is the intention behind?
    Is it meant that we should use a date column as FK reference in the cubes instead of the surrogate key.
    Very odd !!
    regards
    Thomas

    Hi,
    thanks to Google I found Dave Allens excellent paper on [degenerate dimensions|http://blogs.oracle.com/warehousebuilder/2010/05/owb_11gr2_degenerate_dimensions.html].
    Now it's a lot clearer to me.
    Supposing you will read this, Dave, some more remarks:
    1. The date column in the cube is a blessing not only with partitioning. Until now, I used to update the surrogate key of the time dimension to a number of format YYYYMMDD in order to ease my life.
    2. But the time dimension table is still used not a mere stub as with DD?
    3. I don't understand the context with SCD2. There, I need the DIMENSION_KEY.
    4. I have the situation with a fact table containing one row per phone call. The unique phone call ID would be a candidate for a DD. But what would be the advantage to define the stub DD instead of just entering the string ?
    Please give some more hints for a better understanding.
    regards
    Thomas

  • Time Dimension Consistency Error in RSRV - Need Help

    Hello,
    I am having a problem when I run RSRV on our 0ECCS_C01 cube.  We have extended the time characteristics to include posting period (0FISCPER3).  The only problems RSRV finds is when 0FISCPER is period 0 and 0FISCPER3 is 0.  For some reason, these are being flagged as inconsistent.  I think this is causing negative performance on our queries because I feel partitioning may not be getting used from some research I've done due to this inconsistency.
    Here are the errors I am getting from RSRV:
    1.  Record with the DIMID 410 contains non-fitting time characteristics
    Message no. RSCV053
    Diagnosis
    The data record of the time dimension table with the described DIMID contains values for time characteristics that do not fit together.
    2.  This DIMID is used by 9860 records of the fact tables
    3.  No master data found for characteristic of test described subsequently
    Message no. RSCV083
    Diagnosis
    No master record exists for a characteristic used in the time dimension. The characteristic is one of the characteristics described in the following message with one of the SIDs named there or it is the fiscal year variant that was derived from one of the characteristics.
    4.  Time characteristic 0FISCPER value 132000000 does not fit with time char 0FISCPER3 val 0
    Message no. RSCV054
    Diagnosis
    The described values of the specified time characteristics do not fit together.
    How exactly can I get these time characteristics to "fit" properly?  Will it require a data reload?

    hi,
    did u get answer to ur problem.
    thanks.
    Raju

  • Time Dimension in Dynamic Reporting

    When creating a report that compares a current period (for example 2015.FEB) to the same period in the prior year (2014.FEB), what is the best logic to use in a report?  Do I use a local member formula to perform this?  I am willing to build in a property within the Time Dimension table if necessary.
    I will probably have the same need to compare current period (2015.FEB) to prior period (2015.JAN) in the same report.
    The average user isn't very knowledgeable working with reports besides picking from the context drop down so it needs to be where they pick the current month (2015.FEB) and the report does the rest.
    ***It should also be noted that we recently switched from a calendar year to fiscal year so it will not work to reference for example Period 2 in each year since 2014.FEB is period 2 and 2015.FEB is period 11 in each year respectively.
    Thanks for the help.
    Steve

    Shrikant,
    See attached 4 screenshots of all of the properties that I have in the time dimension.
    We only have one hierarchy for time.  As you can see its a little complex going from a calendar year reporting structure to a fiscal reporting structure. 2014 was a "short" year because of the change.
    Thanks in advance,
    Steve

  • 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!

  • Question on Dimension Table

    When we delete a request on a InfoCube, the information not necessary on the Dimension Table does not canceled. For example if we delete all the data about year 2003 on a InfoCube, the information about 2003 continuous to alive on time dimension table.
    Do you know if exists a program or some method to delete the information from the Dimension Table not used on FACTTABLE?
    Best regards,
    Nicola Commari

    Nicola,
    Navigate to transaction RSRV, there exists a test which you can run
    "Entries not Used in the Dimension of a cube" which will help you repair the issue you are currently experiencing.
    Hope this helps.
    Cheers,
    Scott

  • Data warehouse, time dimension

    Dear folks,
    My boss asked me an interesting question, but I couldn't answer, because I'm not an Oracle expert, I'd rather describe myself as Cognos developoer.
    We have a ROLAP data warehouse, and there is a time dimension table, the primary key column has type number. He asked me, why is it worth having a number primary key, and not having the date itself as primary key, because Oracle converts dates to numbers too... So what do you think, what's the difference, wich is the better option?
    Thanks you in advance, and sorry for my bad English.

    Hi,
    I can do it, but this would be usefull only to create "time dimension" table. But also the "sales" fact table needs to be altered (thus, the "time" column will not contain the value of the time, but the ID of the corresponding time in the "time dimension" table).
    I know that on DW this procedure is done automatically by the ETL process.
    My question is that does the repository has any tools similar to this?
    Thank you.

Maybe you are looking for