Two ways to define your own calculations (indicators) in the Business model

As mentioned in the article Oracle BI metadata repository - IV. Create custom indicators , there are two ways to define your own calculations (indicators), namely:

  1. Calculated on the basis of already existing logical columns(see procedure. article above)
  2. Calculation based on physical columns (procedure below)

Not matter which of the above methods you use . For each of them is generated by other physical SQL query, and in certain cases (see below) can affect the accuracy / inaccuracy of the results and even the performance itself query:
  • For calculations on the basis of already existing logical columns , first apply aggregate functions (those that are set to logical columns of which are based), and only then performs the actual calculation
  • For calculations based on physical columns is first performed to calculate and then applies the aggregate functions


An example of when to use a calculation based on physical columns 

for the correct calculation of total revenues for each first row multiplied by price per unit (Unit Price) the number of units sold (Units Sold) and then only applies aggregate functions SUM (). If usethe calculation based on existing logical columns , would be erroneous calculation of total revenues . And because the first apply the aggregate function SUM () "Unit price" is 500 + 400 + 300 = 1,200 "Units sold" is 2 + 3 + 4 = 9 , and only then performs the calculation, which in this case wrong: 1.200 x 9 = 10 800 How to define the calculation based on physical columns firstSelect facts table> right click> New Object> Logical Column ... 2ndName the pointer and select OK. 3rd Choose your source physical logical table and select "Properties ..." 4th Select the Column Mapping tab (here you can see how they are mapped to each logical column from Business Model for the physical layer)> select a new pointer and start the Expression Builder (press ...) 5th In the Expression Builder, define your own calculation of the physical column and select OK 6thThe calculation is displayed in the mapping between business model and a physical layer of the 7th Finally, set an aggregate function for your new indicator and move it into the presentation layer Erik Eckhardt.