Same Measure from the Fact table to be calculated with 2 different logic.

Hi,
I have a BookingsFact having a measure field as BookedWeight and Foreign keys PlantDimKey , DateDimKey, OrderItemDimKey
In the Pivot table report the data(BookedWeight) for the Plants have to be grouped based on the below criteria:
1. If the PlantDimKey is 1  use OrderItemDimKey.
2. If the PlantDimKey is 2 use DateDimKey.
Thanks
Ajit

looks like you need to have conditional mdx logic for this
This has nothing to do with cube design.
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page

Similar Messages

  • Measures in the fact table

    Hello,
    Can i have measures in the fact table in business layer?
    I am using obiee 11g.
    like i have a fact table where i have a user i applied aggregation rule of count distinct.
    Now i would like to add a lower function to it like count (distinct(lower(username)).
    But then it becomes like a measure with fx with the name and not the usual yellow colour.
    Wanted to know if its good practice?
    Thanks

    Hi,
    You have two measure columns.
    one with lower function
    other without lower function.
    For your information: Distinct is case sensitive.It will show the difference between 'A' and 'a'.
    Regards,
    Lakshmipathi.
    Edited by: Lakshmipathi on Jul 7, 2011 2:41 PM

  • Essbase vs. Relational Data Warehouse (Which one is the fact table in DW)?

    Guys, thanks in advance for your feedback but below is a simple question i am trying to get feedback on. I am trying to compare an Essbase cube to Relational Data Warehouse containing the same set of information:
    Essbase Dimensions
    Time, Account, Product, Scenario (making it easy)
    Relational Data Warehouse
    Time (dim), Account (dim), Product (dim), Scenario (Fact table)
    OR
    Time (dim), Product (dim), Scenario (dim), Account (Fact Table)
    Which of the relational lines is correct? Is Account the fact table? or Scenario the fact table? Account will contain your usual P&L accounts. Scenario will contain your usual Actual, Budget and Forecast scenarios.
    Thanks,

    I am so not a DW guy, it's amazing, but I've never let little more than a brush with a product stop me from posting...
    Wouldn't all of your dimensions need to be in your fact table? How else would you join from the fact table to the dimensions?
    In either layout, wouldn't you have the keys for Product, Time, Scenario, Acount, and then data in the fact table?
    Or are you talking about the last dimension in your layouts be the columns? If that were the case (and I don't know that it is), I would guess that Scenario changes less, so it would be in columns, although I can definitely see that not being efficient as you are likely to pull all or some of the Accounts for a given time, product and scenario versus all of the scenarios for a given time, product, and account.
    I'm really curious about this as I am just the consumer of star schemas, never (thankfully, and obviously, given the above insane ramblings) the designer of them.
    Regards,
    Cameron Lackpour

  • Unposted journals still in the fact tables

    Hi!
    Sometimes not very often, but from time to time we have problem with posted journals not showing in the facttables and unposted journal not being eliminated from the fact tables.
    Is someone having the same problem or knows what might cause this problem?
    Usually it´s solved by unposting and posting the journal again, but it´s tricky to know which journals is working or not.
    Regards
    Fredrik

    Hi,
       It is difficult to find an explanation without making some investigation. In order to isolate a little bit the problem, just try to check if the journal data are real into the fact tables and in which one(WB, FAC2 or FACT). Myabe it will be just enough to process the partition to see data. In my opinion is should be related to some thinks that happen in that time into the system simultaneously.
    Hope this can help you,
    Mihaela

  • Duplicate record with same primary key in Fact table

    Hi all,
       Can the fact table have duplicate record with same primary key . When i checked a cube i could see records with same primary key combination but the key figure values are different. My cube has 6 dimentions (Including Time,Unit and DP) and 2 key figures. So 6 fields combined to form the composite primary key of the fact table. When i checked the records in se16 i could see duplicate records with same primary key. Ther are no parallel loading happening for the cube.
    BW system version is 3.1
    Data base is : Oracle 10.2
    I am not sure how is this possible.
    Regards,
    PM

    Hi Krish,
       I checked the datapacket dimention also. Both the record have same dimention id (141). Except the Keyfigure value there is no other change in the Fact table record.  I know this is against the basic DBMS primary key rule. But i have records like this in the cube.
    Can this situation arise when same records is there in different data packet of same request.
    Thx,
    PM
    null

  • Record count is more in the Fact tables when compared to Cube data!

    When i delete request from my cube it is not getting deleted from the fact table. Cube shows around 3.5 million records but when I checked in the fact table it was showing more than 11 million records.

    Hi Kingsley,
       You may try this approach.
       1. Use TCode listschema
       2. Select the type of cube abd give the cube name as well.
       3. This will display the table sinvolved in the cube(star schema).
       4. Select the Ftable listed there and see the number of rows in it.
       Inorder to delete the entire data from cube, you may need to delete all the load requests that has happened before as well.
       Hope this helps...
    Thanks,
    Raj

  • Constructing Calculated Measures in MDX for different measures using same columns in a fact table

    Hello,
    i have a fact table with 2 columns corresponding to dimensions Dim1, Dim2. In the same table i have 4 other columns Value_Type(int), INT_VALUE(int), FLOAT_VALUE(float), TEXT_VALUE(string). There are a number of measures which are identified by Value_Type and
    depending on their nature could be written in one of the 3 columns (INT_VALUE(int), FLOAT_VALUE(float), TEXT_VALUE(string)) Let's say Measure1 with Measure_Type=1 is age, 2 is account balance and 3 is Name for clarity. There could be other measure types that
    use these 3 same columns for data. So the sample fact table looks like this
    Dim1 Dim2 Measure_Type INT_VALUE FLOAT_VALUE TEXT_VALUE
    10 10 1 25
    10 10 2 2000,34
    10 10 3 John
    10 20 1 28
    10 20 2 3490,23
    10 20 3 Frank
    My task is to write an MDX query for each Dim1, Dim2 combination which returns all 3 measures in the same row. The idea is to construct a calculated member for each Measure that returns value from the right field. For example for Measure1 we take INT_VALUE
    with measure_type=1. The problem is i don't know how to construct MDX query for these calculated members. Can you please help me?
    So my final goal is to write an MDX query that returns all measures in one row for each set of Dim1, Dim2
    SELECT [Measure1], [Measure2], [Measure3] ON COLUMNS,
    NON EMPTY [Dim1].[Dim1].[Dim1].Members*[Dim2].[Dim2].[Dim2].Members ON ROWS
    FROM [Cube]
    Dim1 Dim2 Measure1 Measure2 Measure3
    10 10 25 2000,34 John
    10 20 28 3490,23 Frank

    Hi Kosmipt,
    I would combine the "INT_VALUE", "FLOAT_VALUE" and "TEXT_VALUE" columns into one with STRING data type for the fact table. And there should be one dimension to store the Measure_Type informations. Then in cube, you can write MDX scope for every one of
    "Measure_Type" dimension members. For example,
    scope(
                [Measures].[M]
        [DimMType].[MType].&[1]= CINT([Measures].[M]);                                                                                                                             
    end scope;
    Once the cube is built by the above way, you can write MDX like something like the following to achieve your purpose.
    WITH member [Measures].[Measure1] AS ([DimMType].[MType].&[1],[Measures].[M])
             member [Measures].[Measure2] AS ([DimMType].[MType].&[2],[Measures].[M])
             member [Measures].[Measure3] AS ([DimMType].[MType].&[3],[Measures].[M])
    thanks,
    Jerry

  • How to force BI Server to pick from the Agg table and not the Fact table?

    Hi All,
    I have 3 tables as the Sources in the Key measures. 2 are fact tables and the other one is the agg table.
    E.g.
    Fact 1 at A,B,C,D and E level
    Fact 2 at A,B,C level
    Agg at A,B,C level which contains the measures from the Fact1 and Fact2
    So when I select the measures from the Agg which are coming from Fact1 the Agg table get fired and when I select measures from Agg which are coming from Fact2, the Fact2 table gets fired in the SQL Query.
    Now my question here is there anyway to tell BI Server that when I select Fact2 measures fire the Agg table and not the Fact2 table. The reason being the Agg and Fact2 tables are at the same level.
    But I need to keep the Agg table as it is one level higher than the Fact1 tables.
    Any pointers would be helpful.

    hi,
    you explain us your situation really good.but you forgot to tell us the most import,the measures in aggregate table and the aggregated dimensions.
    meaning,you have 7 measures aggregated in some levels of your dimensions tables?if yes,there is no possibility Bi goes anywhere else..(by choosing only these measures and the defined levels at your dimensions..)
    One more thing,if you choose a combination of your 2 fact data sources,bi goes?where???
    hope i helped...
    http://greekoraclebi.blogspot.com/

  • Can date be included in the fact table as a measure?

    Dear All,
    I have to migrate a database form relational model to dimensional model. It a kind of human resource database. I don't know what MEASURES should I keep in the fact table. There are only dates, like date the employee joined the institution and the date he will leave. Most of the other fields are non-numeric. well date is also non-numeric but we can calculate the duration the employee worked from these dates.
    What do you suggest?

    I'd be careful about adding a "measure" of duration worked (be it days, months, years - doesn't matter). Causes lots of churn. For example, if you choose a measure of "duration_worked_in_days" - every single row in the fact table would be obsoleted every single day....
    What types of questions do you expect the fact table to answer?
    I'm working on a HR mart right now, and my fact data is around pay rates (not actual pay), i.e. annual salary, hourly salary, etc. My records also have two "date" dims - effective start date and effective end date. Meaning if my annual salary is $50 a year between 1/1/2008 and 12/31/2008, that's what the row shows. When (or if) I get a pay raise (/cut), the "current" record gets end dated, and a new record inserted.
    When you say that a fact table "must" contain measure columns - I assume you're using the actual OWB fact / dimension objects, vs. just tables? Very common in a HR data warehouse to have a "factless" fact table.
    Hope this helps,
    Scott

  • Looping the same answer from the 1st row in the table

    I have a database with 3 tables: (1) employeeTable (2) cityTable (3)stateTable.
    I reference the employee's city name and state code by each id number from the cityTable and stateTable.
    My Employee table has about 10 records, 3 has an idcity and idstate input, the rest are blank.
    (1st row) id 9 for Henderson, id 28 for NV (6th row) id 9 for Henderson, id 28 for NV, and (10th row) id 10 for Las Vegas, id 28 for NV
    I run a query:
    <cfquery datasource="dsnName" name="qEmployees">SELECT * FROM users ORDER BY lastName ASC</cfquery>
    <cfquery datasource="dsnName" name="qState">SELECT code FROM states WHERE idstate=#qEmployees.idstate#</cfquery>
    <cfquery datasource="dsnName" name="qCity">SELECT name FROM cities WHERE idcities=#qEmployees.idcity#</cfquery>
    a run the table output:
    <table>
        <cfoutput query="qEmployees">
        <tr>
            <td>#qEmployees.lastName#, #qEmployees.firstName#</td>
            <td>#qCity.name#</td>
            <td width="40">#qState.code#</td>
            <td width="60">#qEmployees.zipCode#</td>
        </tr>
         </cfoutput>
    </table>
    PROBLEM:
    All 10 records output in the table as the same answer from the 1st row (Henderson, NV).
    What's making this loop having the same answer from the 1st row and affects all the rows with blank info or different info?
    I've been trying to figure this out for weeks and I hope the community can help me out. Thanks!

    As Dan rightly says, take a look into table joins; there's no point just giving you the answer as you'll just get stuck next time and these forums are to help people rather than to do their jobs for them.
    What you're looking to do is a relatively simple join, so you shouldn't have to read up for long before you've mastered them. Plus your site will be significantly more efficient

  • Unexpected results getting data from two fact tables through conformed dim

    Hi all,
    We are getting an unexpected behaviour in our OBIEE 10.1.3.3.3. We have this scenario:
    We have {color:#0000ff}2 fact tables{color}{color:#000000} called F1 and F2. F1 has one measure, f1m1 and F2 has another one, f2m1.
    We have {color:#0000ff}4 conformed dimensions{color}, called D1, D2, D3, Date.
    When we are requesting for individual fact tables, we are getting:
    date d1 d2 d3 f1m1
    dt1 - x - y - z - m1
    dt1 - x - y - z' - m2
    date d1 d2 d3 f2m1
    dt1 - x - y - z - m3
    dt1 - x - y - z'' - m4
    But, trying to obtain a compare scenario, we are getting
    date d1 d2 d3 f1m1 f2m1
    dt1 x y z m1 m4
    Instead of
    date d1 d2 d3 f1m1 f2m1
    dt1 x y z m1 m3
    Looking at query log, we have catched the reason. That's why BI Server is using to solve this request using ROW_COUNT() to join SAWITH0 and SAWITH1 in SAWITH2 result set. So, the order may not be the same in the results sets in every fact table. More or less, generated query is like:
    WITH
    SAWITH0 AS
    (select ....
    from F1),
    SAWITH1 AS
    (select ...
    from F2),
    SAWITH2 AS
    select from (select ...
    ROW_NUMBER() OVER PARTITION (....) c10
    from SAWITH0.d1 full outer join SAWITH1.d1 ....) D1
    {color:#ff0000}where (D1.c10 = 1){color}
    select SAWITH2. ....
    from SAWITH2
    order by c1..c10
    The problems seems to be that BI server is ordering the result sets SAWITH0 and SAWITH1 and getting row number to join this results sets, but this is not getting the correct result.
    Any ideas?
    TIA
    Javier
    {color}
    Edited by: jirazazábal on Mar 13, 2009 2:46 PM

    I have done a logical fact table with two fact table source on it.
    The Sql performed against the database was this one.
    -------------------- Sending query to database named PRODS_AIX (id: <<153418>>):
    WITH
    SAWITH0 AS (select sum(T21296.CONSUMERS_SALES_EURO) as c1,
         T21309.DIVISION_CODE as c2
    from
         DIVISION T21309,
         C_CONSUMERS_SALES T21296
    where  ( T21296.DIVISION = T21309.DIMENSION_KEY )
    group by T21309.DIVISION_CODE),
    SAWITH1 AS (select sum(T21356.ORDER_VALUE) as c1,
         T21309.DIVISION_CODE as c2
    from
         DIVISION T21309,
         DWH_SALES_ORDER_OVERVIEW T21356
    where  ( T21309.DIMENSION_KEY = T21356.DIVISION_KEY )
    group by T21309.DIVISION_CODE)
    select distinct case  when SAWITH0.c2 is not null then SAWITH0.c2 when SAWITH1.c2 is not null then SAWITH1.c2 end  as c1,
         SAWITH0.c1 as c2,
         SAWITH1.c1 as c3
    from
         SAWITH0 full outer join SAWITH1 On nvl(SAWITH0.c2 , 'q') = nvl(SAWITH1.c2 , 'q') and nvl(SAWITH0.c2 , 'z') = nvl(SAWITH1.c2 , 'z')
    order by c1As you can see one select (SAWITH0) for the first fact table C_CONSUMERS_SALES and one select for the second fact table DWH_SALES_ORDER_OVERVIEW (SAWITH1 ) and the two statement are joined with a full outer join.
    I ask me why you have the three select (SAWITH0,SAWITH1 and SAWITH2). Can you please paste the complete SQL performed ?
    Can you tell us also which SQL is performed if you select only the columns from one fact table and not for the other ?
    Regards
    Nico
    http://gerardnico.com

  • How to change the fact table in backend query

    Hi
    I have a criteria where f1 is the fact table comming in backend query, how can I change/modify so that if i select same criterian it should come different fact table f2.
    Please suggest.

    Hi Hussain,
    I have a measure 'po amount' which is comming from two fact tables cost_f and line_f from physical layer. I have a implict fact column in presentation layer on a column(internal-row count) from cost_f table.
    Now, when I take only 'po amount ' in criteria, in the backend query it should have cost_f table, but i am seeing line_f table.
    The reason I am checking in this direction is.
    I have criteria with 4 columns and measure column 'po amount' and run the result it is fecting from line_f table.
    The same 4 columns and measure column 'po amount' and one new column 'cost center' is added to the critera the fact table changes to cost_f table.
    In both the cases the result should result from cost_f table, not sure why line_f is comming in backend query.
    Please suggest.

  • Content Tab: None of the fact tables are compatible with the query request

    Hi All,
    **One thing I am not clear yet of all my years with OBIEE is working with the content tab in BMM.**
    I have made a rpd the joins in physical layer as shown below:
    https://picasaweb.google.com/114804305606242416264/OBIEEError#5663056545119428530
    And the BMM layer as:
    https://picasaweb.google.com/114804305606242416264/OBIEEError#5663056519553812930
    Error I am getting when i run a request from the 3 columns from the selected 3 tables is:
    Dim - Comment Code Details
    Fact - Complaint
    Dim - Service Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14020] None of the fact tables are compatible with the query request Sr Num:[DAggr(Fact - Complaint.Sr Num by [ Dim - Service Details.Sr Cat Type Cd, Dim - Comment Code Details.Cmtcode name] )]. (HY000).
    I get no error for consistency.. I read everywhere and I know i need to set the appropriate aggregation levels in the various dims and facts LTS properties to help OBIEE understanding our model, but how to do that.. how do i decide... how should I approach, what should be the aggregation level, what details.
    When i click More button i see different options: Copy, Copy From, Get Levels, Check Level, what do these mean.
    Aggregation Content, group by - Logical Level or Column which one should i choose and how should I decide.
    Can anyone explain the Content Tab in details and from scratch with some example and why we get these errors.... I know many people who are well versed with many other things related to RPD but this. A little efforts of explaining from you guys will really be appreciated.
    Thanks in advance,
    Dev

    Hi Deepak,
    Option 1:
    My tables in physical layer are joined as below:
    D1--> F1 <--D2--> F2 <--D3
    Same way i model it in BMM
    D1--> F1 <-- D2--> F2 <--D3
    Here D1 is non Conformed Dimension for F2 and D3 is non Conformed dim for F1. Later create Dimensional hierarchies, I tried setting up the content levels
    I go Sources>content tab of Fact F1 I set
    Dimensions----------- Logical level
    D1---------------------- D1 Detail
    D2---------------------- D2 Detail
    D3---------------------- D3 Total
    then, I go Sources>content tab of Fact F2 I set
    Dimensions----------- Logical level
    D1---------------------- D1 Total
    D2---------------------- D2 Detail
    D3---------------------- D3 Detail
    Then, I also go in all the dimensions and set their content levels to Details, but it still gives me errors not sure where I am going wrong in setting the content levels.
    I need to know whether the way I have modeled it in BMM is right,
    Option 2:
    I can combine the two facts in a single Logical Fact or the above design should also work.
    (F1&F2)<--D1, D2 , D3 joined separately using complex logical joins.
    what will be the content tab details?
    Thanks,
    Dev

  • Error for the fact table while processing the cube - attribute key cannot be found when processing

    Please help as I am new to SSAS and this is urgent requirement. This is a MOLAP cube and below is the error that I am receiving when processing the cube. The cube is set to Prrocess Full. Several similar errors are popped up for various dimensions.
    "Errors in the OLAP storage engine: The attribute key cannot be found when processing: Table: 'Fact_Table', Column: 'ID', Value: '1'. The attribute is 'Id'. Errors in the OLAP storage engine: The attribute key was converted to an unknown member because
    the attribute key was not found. Attribute Id of Dimension: 17 - Ves - PoC Cont from Database: DB, Cube: IPNCube, Measure Group: iSrvy, Partition: Partition1, Record: 1."
    Thanks in advance.

    Thanks for the recommendations David.
    It will be really great if you can clear some of my doubts:
    To my information, all the dimensions need to be processed first and then the fact table will be processed.
    So if the ID's are not present in the dimension tables, then it should not be present in the Fact table either.
    Here we found null values in the dimension table and the ID's were present in the Fact table. What might be the reasons causing such situation?
    Also how frequently the cube needs to be processed? Currently the ETL which processes the cube, is scheduled in a SQL Job Agent on hourly basis everyday. 
    Is there any possibilty that the cube might be under processing state and the SQL job for the next run getting executed trying to access and process the cube while it was still processing?

  • Essbase answers - None of the fact tables are compatible with the query request "member"

    Hi,
    I have modelled an Essbase database into the repository.
    If I pull the measure, period and year dimension in and filter on the year (member) and display the year (member) along with the period (alias) and measure it errors with =>
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 14020] None of the fact tables are compatible with the query request Fiscal Year.Fiscal Year Code. (HY000)
    However, all other things being equal if I change the year displayed to the alias then it works.
    Anyone tell me why??
    Is there a limitation that Essbase brings through that you cannot view what you filter on?
    thanks,
    Robert.

    Hi
    i have done the content level setting in each of the table, D1,F1 and F2(LTS), now i am getting the following error..
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 15018] Incorrectly defined logical table source (for fact table Gl Sets Of Books) does not contain mapping for [Code Combinations.Code Combinations.Affiliate, GL Balances.GL Balances.Currency Code, GL Balances.GL Balances.PTD_Balance, Gl Sets Of Books.Gl Sets Of Books .SoB Name]. (HY000)
    Gl Balances : D1
    Code Commbination: F1
    Gl Sets Of Books : F2
    I have checked the joins in physical and BMM layer..all are fine..

Maybe you are looking for