Measures in different levels

I am having problems with measures based on different levels of a dimension.
The situation is: I have a product dimension with 2 levels (category and detail) and a client dimension. I want a measure with the number of distinct clients wich buys each product (it works fine with count distinct). But I also want a measure with the number of distinct clients wich buys the category of products, wich it's not working.
I have tried level based measures, but it didn't show the right result. I have changed the aggregate rule for this measure to count distinct, but it shows the same result as the SUM.
Can I define a custom rule for aggregation based on attributes of another tables?
Does anyone know a solution for this?

The output of the reports needs to be as below which shows details of a single customer.
customer_name---ca_number-----obl_number--------gl_balance--------limit_available-----state
Krio motors---------222222222-----763764754---------37000.00--------1834297.00--------CA
Krio motors---------222222222-----326635675---------34820.00--------1834297.00--------CA
Krio motors---------111111111-----326684759---------670000.00------3456789.00--------CA
Krio motors---------111111111-----326611111---------32400.00--------3456789.00--------CA
Krio motors---------111111111-----326622222---------8700.00----------3456789.00--------CA
Krio motors---------111111111-----326633333---------632450.00------3456789.00--------CA
here for each record in dimension D6 (for each Ca_number) there are many records in dimension D1 (obl_number records)
The limit_available is at ca_number level (higher level) and gl_balance is in obl_number detail level.
Thank you.

Similar Messages

  • Measures at different levels

    I have a fact table which contains sales order lines. Also in this is fact is reserved stock which will be used to fill those sales order lines. Each sales order lines can be fulfilled from multiple stock locations. Thefore, I have a fact table that resembles something like this for a single order line:
    Order Line Number, Order Line Quantity, Stock Lot Number, Reservation Quantity
    ORD_LINE1, 35, LOT1, 10
    ORD_LINE1, 35, LOT2, 17
    ORD_LINE1, 35, LOT3, 8
    My problem is that the Order Line Quantity measure, when totalled in OBIEE is giving me 105 (35*3) - when it needs to be 35.
    How can I show a total of 35 for Order Line Quantity, at the same time as showing 35 for Reservation Quantity?
    My underlying SQL query is very performance sensitive so would like to stay away from analytical functions. Is there something I can do with hierarchies?
    This is OBIEE 10g
    Edited by: 934462 on 06-May-2013 03:09
    Edited by: 934462 on 06-May-2013 03:15

    It looks like your quantity only depends on order line number while "reserved" measure is dependent on lot and order line number. So, you have combined measures of two different grains in the same table. You can do following:
    1. Address the problem at the database level by splitting this into two separate facts and model them as two logical facts connected through a single dimension order line number. This is cleaner and it should run faster.
    OR
    2. You can copy ordered quantity as a new logical column but do not set any aggregation rule. Bring it into presentation layer and use it as a common attribute of order line in your report. Since this column would be part of group by, it may sacrifice some performance.
    OR
    3. In the ordered quantity measure, go to aggregation tab, check "Based on Dimensions", in the new list, choose MAX() as the aggregation rule for Order lines dimension (create a logical table and associated dummy hierarchy of sales order line attribute if you dont have them) and SUM() as aggregation rule for stock location dimension. This is slightly experimental, I doubt how much it would help in your scenario.

  • Calculate based on different level-based measures

    Hi,
    Say that I have a Sales measure and a Region dimension as the following:
    Region: Country -> State -> City -> Individual Stores
    The Sales measure is aggregated by SUM along the dimension. I'd like to create another measure that when the user browses to each level, the measure calculates the ratio of the current Sales measure to its immediate parent level's aggregated Sales total.
    For example, at the City level, the ratio will be City.Sales / State.Sales. At the individual store level, the ratio will be IndividualStores.Sales / City.Sales.
    I know I can probably create one total Sales level-based measure at each level. But then that would give me multiple ratio measures as well, which I don't want. Is there any way to have only ONE ratio measure that reflects the ratio at each level depending what level the user is viewing?
    Thanks.

    JLin,
    I think you were right when you were saying that you could create several metrics. I looked at your requirement again and realized that those are indeed separate metrics - since they use different columns for sales. So you can:
    a) create aggregate tables and set LTS there (easiest I think)
    b) adjust your ETL by creating a pre-calculated column based on your requirements
    c) create a long CASE statement - but I'm still not sure how to define hierarchies....variables perhaps...maybe MMA could shed some light into it....
    good luck

  • Report with same measure but opened by 2 different level of emp hierarchy

    Hi all, I need to have a report with columns like these:
    COLS: Region -- Employee Level 3 -- Product Class -- Forecast ($) for Emp Level 2 -- Forecast ($) for Emp Level 2
    SAMPLE: NAS -- Anthony Fernicola -- Apps -- 100 (forecast for Anthony) -- 500 (forecast for Anthony's manager which is Keith Block)
    I mean, on the report criteria I drag those columns and and from the emp hierarchy dimension I drag that EMPLOYEE LEVEL 3 column since the report must show all those employees for that level, but as you can see on the same line of the report we should show as well the forecast for the manager, in this case the EMPLOYEE LEVEL 2..
    To get that measure I tried:
    1) on the formula the SUM (forecast($)) BY EMPLOYEE LEVEL2 but the data is not matching the real data..
    2) I also tried to use the FILTER function on the formula but I don't know how to filter it since it requires a filter_expression that I cannot give, I just want to show on that "Forecast ($) for Emp Level 2" column the forecast measure by that level 2..
    3) I also tried UNION but on the results the report is showing as well the LEVEL 2 for the employee and we do not want it since we want to show all LEVEL3 only...
    do you know how to do this?
    thank you!!!!

    Are you sure the brackets are in the right location?
    This:
    SELECT
    0 s_0,
    "A - Sample Sales"."Sales Person"."E1 Sales Rep Name" s_1,
    "A - Sample Sales"."Sales Person"."E9 Manager Name" s_2,
    "A - Sample Sales"."Base Facts"."1- Revenue" s_3,
    SUM("A - Sample Sales"."Base Facts"."1- Revenue" BY "A - Sample Sales"."Sales Person"."E9  Manager Name") s_4
    FROM "A - Sample Sales"
    ORDER BY 1, 3 ASC NULLS LAST, 2 ASC NULLS LAST
    works fine for me
    Regards
    John
    http://obiee101.blogspot.com
    http://obiee11g.com

  • OBIEE report from multiple facts at different levels

    Currently we need to develop a report with columns from 3 different facts surrounded with conformed and non conformed dimensions at different levels.
    After setting the hierarchial levels and putting the facts into single logical table with different sources OBIEE is generating 2 different queries and does a full outer join.
    I would like to know how we can do a left outer join instead of full outer join between the 2 queries based on a common column?
    Thanks in advance.

    Hi Vinod,
    The scenario provided in the link above doesnt match to my issue.
    We need to develop a report from multiple fact tables at different levels with conformed & non conformed dimension columns.
    I have 7 dimensions D1, D2, D3, D4, D5, D6 and D7 & two fact F1 and F2 tables.
    F1 is tied to dimensions D1,D2,D3,D4,d5
    F2 is tied to dimensions D3,D4,D5, D6 and D7.
    In my report I have columns from D1, D2, D3, D4, D5, D6, D7, F1 and F2.
    So OBIEE generates 2 queries with columns from D1,D2,D3,D4,d5 & F1 measure and another query with D3,D4,D5, D6, D7 and F2 measure.
    and then does a cross fact join out of box between 2 queries.
    But I need to do a left outer join between the 2 queries on a common column instead of cross fact join. I would like to know how we can achive this.
    Thanks.

  • Displaying different levels of the same hierarchy in the different columns

    I have a parent child hierarchy and wish to display different levels of the hierarchy in different columns of the resultset eg
    level 1 level 2
    Europe UK
    Europe France
    N America US
    N America Canada
    However writing MDX like the below
    select
    {} on 0,
    ([Geo].[level 1],[Geo].Level 2] on 1
    from cube
    results in the error "The [Geo] hierarchy is used more than once in the crossjoin
    How can I get around this??

    Hi,
    You can make use of CrossJoin function in MDX, I give a sample MDX based on the AdventureWorks database:
    select {[Measures].[Reseller Sales Amount]} on 0,
    crossjoin({[Sales Territory].[Sales Territory Group].[Sales Territory Group].members},{[Sales Territory].[Sales Territory Country].[Sales Territory Country].members}) on 1
    from [Adventure Works]
    After execut the MDX you will get the result like this:
    Reseller Sales Amount
    Europe
    France
    $4,607,537.94
    Europe
    Germany
    $1,983,988.04
    Europe
    United Kingdom
    $4,279,008.83
    NA
    NA
    (null)
    North America
    Canada
    $14,377,925.60
    North America
    United States
    $53,607,801.21
    Pacific
    Australia
    $1,594,335.38
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Nesting of AGO or TODATE functions with differing level arguments is not supported

    I have a column in BMM which calculates the Year-To-Date Sales. This function uses the ToDate function to caculate the YTD.
    I need to develop another formula column which shows the last-year's YTD.
    I develop this formula in BMM by AGO on the YTD column which already uses a ToDate function.
    In BI Answers when selecting this column, results in the below message:
    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: 22044] Nesting of AGO or TODATE functions with differing level arguments is not supported. (HY000)

    To reply to my own question. It appears I got it working, that is, the error message problem is solved, but I still have questions on how to use these functions.
    To get it to work, I added the primary key D_TIJD.TIJDKEY at the level of the lowest grain in my dimension (level tab).
    What I still wonder is how to make it select the right values. I have the following hierarchy: bookyear - bookperiod - week. A bookperiod contains 4 or 5 weeks (4,4,5 in a quarter), so 12 periods in one year. I defined a measure at period level and another at that level with the ago function, that should return the figures for that same period of the year before. My first question is, whether to go back 12 periods or 52 weeks (which is the lowest grain in my dimension)?
    The second question is how to use a combination of TODATE and AGO so that if I calculate the current period (of which only 2 weeks are passed), I also only want to include the same two weeks for that period one year ago in order to make a correct comparison. How do I do that???

  • Substract as an aggregation rule for different level in a DIM ?!

    Hi there..
    I'm building a BI model based on financial transactions (incomes, expenses, etc..)
    and my main problem is how to substract a measure, where the aggregation rule is set to SUM, for different levels in the "Account" dimension?
    Example:
    I have the "Account" dimension with the following hierarchy:
    Account_ID / Account_name / Account_type / Account_total
    And, lets say, 2 rows in it:
    1.row in the "Account" dimension:
    account_ID : 100
    account_name : "Marketing expense"
    account_type : "Variable expenses"
    account_total : "Total profit" (total income - total Expenses)
    2. row in the "Account" dimension:
    account_ID : 200
    account_name : "Financial incomes"
    account_type : "Total incomes"
    account_total : "Total profit" (total income - total Expenses)
    "Total profit"
    "Tot. incomes" "Tot. Expenses"
    "Finan. incomes" "Market. expenses"
    The fact table has just one measure: "Amount" and, of course, some foreign keys:
    Account_ID -> "Account" dim
    Organization_ID -> "Organization" dim
    Date -> "Date" dim
    Amount
    The measure "Amount" in the fact table is positive both for expenses and incomes.
    Now, what I'm trying to do is to sum up that measure on my top level in the "Account" dim.
    At that level my report in Answers should substract "Total expenses" from "Total incomes"!
    How can I do that?
    thanks..
    Ivan

    Sorry to pop the obvious question, but can't you model that nicely and put it into distinct columns?
    If not, you can create derived measures on you fact using "case when" statements. One for the incomes with amount > 0 (or >=0 ...depends on where you want to have the 0's) and one for the expenses with amount < 0.
    HTH,
    Chris

  • Extract Data in Power Pivot from MDX with diffrentnt different Level of Hierarchy in MDX

    Hi All,
    My requirement is to extract the data form tabular model and put in power pivot,as all the measures calculation is present in model just extracting the aggregated data.
    Issue is appearing on Rolling up the data, so is there any way to extract the data so that it will display the right data on different level. As per the below example on level 2 data is getting summed up which is not correct.
    Ex:-
    Level1
    A
    10%
    B
    20%
    Level2
    30%
    Thanks Chandan

    Hi Chandan,
    According to your description, you create a SQL Server Analysis Services Tabular model and extract Data in Power Pivot from MDX, the problem is that the hierarchy data rolling up base on the hierarchy level, right?
    I have tested it on my local environment, we cannot reproduce this issue. So as per my understanding, the issue can be cause by the hierarchy setting in your tabular model. Here are some links about how to create and manage hierarchies in a tabular model,
    please refer to the links and check if the settings are correct.
    http://msdn.microsoft.com/en-in/library/hh213003.aspx
    http://www.youtube.com/watch?v=qKKNY1Vj_2c
    If the issue persists, please provide us more information about you hierarchy creation steps, so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Different levels of a dimension

    I am having problems with measures based on different levels of a dimension.
    The situation is: I have a product dimension with 2 levels (category and detail) and a client dimension. I want a measure with the number of distinct clients wich buys each product (it works fine with count distinct). But I also want a measure with the number of distinct clients wich buys the category of products, wich it's not working.
    I have tried level based measures, but it didn't show the right result. I have changed the aggregate rule for this measure to count distinct, but it shows the same result as the SUM.
    Can I define a custom rule for aggregation based on attributes of another tables?
    Does anyone know a solution for this?

    Luciene,
    Is your requirement to have seperate metric for the category and a seperate metric for the detail level? if so then you can duplicate the count distinct metric and specify the level for the product dimension.( for the category metric it would be at the category level and for the detail metric it would be at the detail level). But on the other hand if you want the same metric to act at different levels, then you don't have to create a level based metric. Pulling the category/detail and the metric would aggregate the metric to the specific level.
    Arjun

  • Different aggregations at different levels

    When I view the data using 'Measure Data Viewer', the items in a dimension are showing in random order.
    How do I load the data in a dimension in ascending order so I can view it in ascending order.
    Also, is it possible to apply different aggregations at different levels in a dimension?
    Thanks.

    Thank you. I will put different measures with different dimensions in different cubes.
    After I mapped my measures in the mapping canvas(I can see the mapping lines), I tried to maintain the measure. But I am getting an error 'some-measure-name may not be maintained since mapping do not exist for the measure'.
    I am using AWM 10.2.0.3A and the database is 10.2.0.4
    Thanks

  • Relating facts to different levels of a dimention

    Dear All,
    I need to relate a fact to optionally different levels of a hierarchy in a dimension
    that's sales plan may be put on the level of a salesman or a distributor or a channel and so on ...
    I think that it could be implemented by adding a dummy record in a each level that represent the parent .. but i don't konw how to add this dummy record in owb ...
    can you help ..
    Regards,
    Shaimaa

    Hi Shaimaa,
    this is actually a very difficult business question. Technically, it's straightforward.
    The easy part is to create one fact table per dimension level where you have a plan. So, you would have a SalesPersonPlanFact, a SalesManagerPlanFact, and so on. That will work technically . . .
    But it won't really work. :-(
    The reason is that the way these plans are created. Typically, the Boss and his guys work out a master plan. Then it gets broken into bits, and each department does their own sub-plan. All the way down, until it gets to individual sales plans. And at every step of the way, the plan gets tweaked, modified, 'special cases' put in.
    The result is that they never add up. How you resolve that is a business issue, not a technical one.
    Me? What I do is tell people that they won't add up, and then say that it doesn't matter anyway. The reason I give is that the purpose of the plan is to measure actual sales performance against plan, and that we can do. Sales take place at the most atomic level for which there is a plan, and these we can match and consolidate plan against actuals. The consolidated results are then MVed and thus present a high-performance single picture of 'the truth'.
    Realistically, you're building a second-level snapshot (could be aggregated, could be periodic, could be both), and that's your reporting structure.
    I suspect you may need to go and have a re-think about your value chain, and do much communication with your sponsors so that they understand what's achievable and of real worth to the business. After all, your business as a data warehouse architect is to ensure you're publishing the right data.
    Cheers,
    Donna

  • About different levels of detail in BSC

    Hi, could someone tell me what should I do if I have a measure in my BSC in SEM-BW 3.5 (this measure is "Total Expenses" of the company) but the user wants to display it by Department (a characteristic of the info cube).
      Can I do that in my BSC in a natural way?
      Thanks in advance.

    Anyone have any thoughts on this?
    Data fact with 2 sources, where source 1 & 2 have differing levels of detail, it always seems to take the data from the more detailed source

  • Data loading at different levels

    We are using Oracle 10g and AWM 10.2 tools to re-write the current Oracle Express application. We have created couple of standard cubes in AWM and it works fine. The design confusion is in one of the case. It is explained below
    We are planning to load targets into one of our AW.
    Following are the details
    Dimensions hierarchy
    1. Time Year==> quarter==> Month
    2. Point Of Sale(POS) Worldwide ==> Region ==> Country ==> Territory
    3. Origin Worldwide ==> Country ==> Territory ==> City
    4. Destination Worldwide ==> Country ==> Territory ==> City
    Measure
    rev_tgt
    The challenge is, the target are set in the warehouse at different Point Of Sale levels. i.e. For some POS the targets are set at country level, for some they are set at territory levels. e.g. For India the revenue targets are set only at country level where as for France the targets are set at all the territories of France. The requirement is to show targets at all the levels in the POS above where it is set. The bottom line is that the data is not availble at a fixed level and the dimesion levels are fixed and cannot be ragged.
    Query:
    How we can design a cube that loads data at different levels and then aggregate the same across all dimension including the higher level of POS dimension.
    Solution in the existing Oracle Express
    In the current Oracle Express, what we are doing is since we have control over the aggregate program, we have created two aggmaps one with POS and one without. We do two step aggregate for the first one we limit the POS to country level and do a rollup using the aggmap that includes POS. Then we limit POS to all and aggregate using the aggmap without POS.
    Can you please assist us on how to implement the above with the AWs.

    Hi,
    Check the below wiki link,
    http://wiki.sdn.sap.com/wiki/display/BI/Aggregates--SAPBWQueryPerformance
    Edited by: Priya.D on Apr 8, 2010 3:20 PM

  • Display different level for same hierarchy value in BO 4.0

    Hi Expert,
    I have one question for Webi for BO 4.0
    We have one hierarchy in BW side and we hope to display differet level in same report for different column
    For example, column A is for level 6. column B is for level 7.
    Do you know how to releaze this in Webi side?
    In the 3.X version, we have different dimension for different level.
    But now in BO 4, it has been combined into one\
    Thanks and best regards
    Alex yang

    Hi,
    You can still do this in BI 4.0, if you use the old 'legacy'  MDX OLAP.unv from Universe Designer tool .
    Yes, with the BICS connection,  you are getting a native hierarchy, as it would be displayed in an OLAP environment.
    Cheers,
    H

Maybe you are looking for