Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

obiee 12c calculated measure from two other measures - incorrect values

Received Response
736
Views
25
Comments
Raj453
Raj453 Rank 3 - Community Apprentice

Hi Gurus,

we have a requirement to create a custom metric in answers. This new metric is the division of other two metrics.

Issue is when i create this new metric and pull the other 2 fields into the f(x) and set aggregation content to average , obiee shows incorrect values.

Third metric is a simple division of first metric (the numerator, its a double and a dollar amount field)  and second metric (denominator, its an integer and a simple "no of orders" field).

I gave the correct aggregation rule,  but showing wrong answers.   I even tried "cast as double"  and "avg" aggregation rule within the F(x) of new metric. Still no luck.

Not sure what went wrong.   Also the first 2 metrics are calculated fields themselves with "sum(max( fact column by some dimensions )) "  kind of calculation with their aggregation rule as sum.

can any one interpret this. appreciated. Thanks.

Sorry forget to mention,  all the 3 metrics are being created in answers, not RPD.  Unfortunately we don't have the option of moving this work to be done in RPD.

«13

Answers

  • Robert Angel
    Robert Angel Rank 8 - Analytics Strategist

    Simple answer, whenever you are looking at division the measure must be physical not logical.

    So recreate a physical measure based on the physical not logical columns - it is down to the difference between aggregate first then divide OR divide first then aggregate.

  • Raj453
    Raj453 Rank 3 - Community Apprentice

    Sorry Robert, did not get you. Physical means the first two metrics should be created in the rpd ?  that is what you mean ?

  • Raj453
    Raj453 Rank 3 - Community Apprentice

    Hi Robert,   here i am creating all 3 metrics in answers, not in RPD. updated the original question.

  • SonPat99
    SonPat99 Rank 6 - Analytics Lead

    Dear User,

    Can you also give some sample values for all 4 columns (new calculated and existing aggregated columns)?

    Also, a screen of what is getting out.

  • Raj453
    Raj453 Rank 3 - Community Apprentice

    Hi,   please see below values.

    A, B, C are 3 metrics.   C = A/B.

    Below are values.

    A  (amt , double)                 B  (no of items,   integer)              C (correct value)                   C  (what i am getting)

    $52.00                                    1                                                        $52.00                                  $52.00   --------->  correct

    $0.00                                      1                                                          $0.00                                   $0.00     ----------->  correct

    $189.80                                   4                                                          $47.45                                $47.45   ---------->  correct

    $522.61                                 9                                                              $58.06                               $46.56   ---> WRONG

    $779.20                                 10                                                            $77.92                               $85.80   --------> WRONG

    $402.00                                  8                                                              $50.25                                        $38.55    -----------> WRONG

  • SonPat99
    SonPat99 Rank 6 - Analytics Lead

    Can you also provide the column formulae used for A, B and C?

  • Raj453
    Raj453 Rank 3 - Community Apprentice

    Column A --     SUM(MAX(fact column by dim1) BY dim2, dim3)

    column B --    SUM(MAX(fact column by dim1, dim2, dim3) BY dim3, dim2)

    both A and B has aggregation rule as  SUM

    As said ,  C = A/B,    C has aggregation rule as AVG

  • Robert Angel
    Robert Angel Rank 8 - Analytics Strategist

    On your measures that are coming out incorrectly have you tried ticking 'server complex aggregate' for those measures?

  • [Deleted User]
    [Deleted User] Rank 2 - Community Beginner

    Your result isn't "incorrect values". You are confusing post-aggregate calculations with pre-aggregate calculations.

    As Robert said in the very first post - htis belongs into the RPD in a physically (nece row-by-row and pre-aggreagte) calculation in the logical layer. NOT a derived calc and NOT a front-end calc.

  • Robert Angel
    Robert Angel Rank 8 - Analytics Strategist

    I know it is not an ideal solution, but I recommended the use of 'server complex aggregate' because it pushes the calculation back to the database, aggregation and all.

    Like you standing on the high ground of good architectural practise I prefer measures in the rpd, but from past experience the sum by two dimensions functionality might rule this out - I know you can create measures pinned to dimensions at a certain level, but depending on how filtered the result is in answers you can struggle to do it all in the rpd.

    I remember a dynamic share of market / share of segment calculation where the client wanted the afore mentioned market / segment population to be based on multiple runtime parameters when I could not get a pure rpd measure to do what was required.