Oracle Analytics Cloud and Server

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

Divide 2 Columns in Union Report

Received Response
239
Views
14
Comments
Ebin Cherian
Ebin Cherian Rank 5 - Community Champion

Hi All,

Oracle Business Intelligence 12.2.1.1.0.

I am struggling to create a calculated column which perform division on Union.

pastedImage_0.png

I need to create a calculated column to perform calculation Amt 1/ Amt 2.

pastedImage_1.png

So far result is correct. Now I am going to add a Region column to both analysis and then exclude it in the pivot table layout. When I do that, Division result is not correct.

pastedImage_2.png

How can I fix this issue ?

Thanks

Ebin

«1

Answers

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

    By looking at the query and your models. Including the Region changes the query grain!

    Look at the two detailed queries. Look at how "Region" changes things. Look at what data arrives and whatt gets calculated.

    This is analytics 101 - you have to get behind it and understand the impact of what you are doing.

  • Joel
    Joel Rank 8 - Analytics Strategist

    If I understand correctly, you want to divide 2 measures derived from a union report. If so, you add a result column and use the syntax saw_0/saw_1 where the number indicates the position of the column in the analysis - where 0 = position 1 and 1 = position 2 etc

    pastedImage_4.png

  • Teresa Modesta
    Teresa Modesta Rank 5 - Community Champion

    If you had the right answer with the region in can you make region hidden using the format properties to get the right result, or does that yield the wrong level of summarisation?

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

    That's my point - it's a conceptual question which may point to insufficient or just completely wrongly done logical modeling.

  • Ebin Cherian
    Ebin Cherian Rank 5 - Community Champion

    Hi Joel,

    I tried that already, but not getting the desired result.

    pastedImage_0.png

  • Ebin Cherian
    Ebin Cherian Rank 5 - Community Champion

    Hiding the region results in wrong level.

    pastedImage_0.png

  • Ebin Cherian
    Ebin Cherian Rank 5 - Community Champion

    Hi Christian,

    Before posting in OTN, I verified the data part. Report total shows the same number with or without region. Only issue is while dividing 2 columns in union report. If I specify the aggregation rule as average for the "division column", then it calculates the average of the division for each record.

    pastedImage_0.png

  • Joel
    Joel Rank 8 - Analytics Strategist

    then you need to look at @Christian Berg's response in your thread. Check your model as you're adding in the Region dimension attribute but you don't want to aggregate at the Region level so I'm personally confused with what it is that you're trying to achieve.

  • Ebin Cherian
    Ebin Cherian Rank 5 - Community Champion

    Sorry for the confusion... We have a different view within same report where Region is used. For the pivot table view in question, it gives a summary and therefore region is excluded.

  • Teresa Modesta
    Teresa Modesta Rank 5 - Community Champion

    If you need a fast fix then you could use the physical sql generated in opaque view or direct database request.

    For a longer term fix I would look at the fact to dimension levels set in the LTS