More Related Content
Similar to Obiee11g beginner's guide adding calculations (20)
More from Amit Sharma (20)
Obiee11g beginner's guide adding calculations
- 1. “OBIEE 11g Repository Beginners Guide”
This is one of our documents from OBIEE11g Beginner’s Guide series. The document focuses on “Adding
Calculation”. To simplify the task we have added many examples in order to ease students
understanding.
History:
Version Description Change Author Publish Date
0.1 Initial Draft Hitesh Mankar 01st Sep 2011
0.1 1st Review Amit Sharma 01st Sep 2011
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 1
- 2. Table of Contents
1. An Introduction to “Adding Calculation” in OBIEE 11g. 01
a. Using physical columns as objects in a formula. 01
b. Using Existing Logical Columns. 07
c. Adding Calculations Using the Calculation Wizard to add calculations. 09
2. Case Studies. 13
a. Calculating Quick Ratio. 13
b. Calculating Gross Margin 15
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 2
- 3. An Introduction to “Adding Calculation” in OBIEE 11g
Adding Calculations
Adding calculations to fact means creating new computed measure columns into fact by applying
calculation formulas, aggregation rules on existing logical column in BMM Layer to meet the business
requirement. These computed measures help end users to get updates such as difference between two
different years’ sales, total growth, difference between units sold and units ordered, ago sales, Profit,
Expenses etc.
There are three ways to add calculations to FACT or creating measures or new computed columns.
1. Using physical columns as objects in a formula.
2. Using Existing Logical Columns.
3. Using the Calculation Wizard to add calculations.
1. Using physical columns as objects in a formula.
1.1) Right click on table select New Object Logical Column click on General tab enter name for the
new logical column.
This measure 5-01 Inventory (Sum All) is created to calculate inventory of a year/quarter/
month/day. (Inventory is defined as assets that are intended for sale, are in process of being produced for
sale or are to be used in producing goods.)
1.2). Click on Column Source tab Select radio button for Derived from Physical MappingsSelect Check
box to Show all Logical Sources.
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 3
- 4. 1.3). Double click on a Logical Table Source In Logical table source window see the new logical column
name Click on Column Mapping.
1.4). Click on physical table drop down to select Physical Table Source Select a column from Expression
and check out the mapping Click ok.
1.4) You can also create a logical column using Edit Expression button Click ok.
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 4
- 5. 1.5). Now select Aggregation Tab to apply a default Aggregation Rule.
1.6). Check out the Icon Differences and verify.
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 5
- 6. 1.7). A business requirement needs to show inventory for all the months of a year like below report.
1.8). Now check into OBI Answers using 5-01 Inventory (Sum All) measure how this business
requirement gets satisfied.
1.9) Sql script generated by OBI Server for the requested report.
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 6
- 7. 1.9) Aggregation Rule Based on Dimension Hierarchy.
1.10) In Aggregation tab Select Based on dimensionClick on others.
1.11) Click on the Expression builder select and aggregate (aggregation rule) and click on the
insert selected item .
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 7
- 8. 1.12) Select logical tables from top left pane Categoryselect a fact table from Logical tables pane then
select a measure from bottom pan click on <<numExpr>> click insert selected item arrow key
and click ok.
1.13) Check out the aggregation expression formula in Aggregation tab.
1.14) Click on green plus sign to add more formula based on logical dimension.
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 8
- 9. 1.15) A business requirement needs to show result like below using this measure 1-44 Revenue(Lst
oT All) based on dimensions for all months of a year.
1.16) Now check into OBI Answers using 1-44 Revenue(Lst oT All) measure how this business
requirement gets satisfied.
1.17) Sql script generated by OBI Server for the requested report.
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 9
- 10. 2. Using Existing Logical Columns.
Instance1. (1-23 Revenue (R3M Daily Avg))
This measure 1-23 Revenue (R3M Daily Avg) is created to calculate Running Daily Average
Revenue of a year/quarter/ month/day.
2.1) Right click on table select New Object Logical Column click on General tab enter name for the
new logical column.
2.2). Click on Column Source tab Select radio button for Derived from Existing Logical Column using an
expression Click on Edit Expression button . (This column doesn’t have any column mapping from
Logical table source).
2.3). Select logical column from logical table Divide the column from variable using Repository
Variable (Enter a slash or punctuation to divide) multiply Repository Variable with a value, enter an
asterisk and value (* 30.4) put the whole formula into bracket shown in below screen shot Click ok.
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 10
- 11. 2.4). Check out the formula for new computed column, The aggregation rule property invisible for this
column and default aggregation rule which is applied for its parent column previously.
2.5) A business requirement needs to show result like below using this measure 1-23 Revenue (R3M
Daily Avg) based on dimensions daily basis like below
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 11
- 12. 2.6) Check into OBI Answers using 1-23 Revenue (R3M Daily Avg) measure how this business
requirement gets satisfied.
2.7) Sql script generated by OBI Server for the requested report.
3. Adding Calculations Using the Calculation Wizard to add calculations.
The Calculation Wizard can create up to four calculation measures. The wizard also prompts you to specify
what value should be returned if the column has no value (like null). This must be specified for all selected
calculations. Select each calculation and specify what value should be returned. You can enter any numeric
value or NULL but don’t enter a value that would change the data type. You can also change the calculation
name at this point which appears in the business model when the Calculation Wizard finishes.
3.1). Select a logical column Right-click and select Calculation Wizard.
3
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 12
- 13. 3.2). In the first introduction screen click on next button.
3.3). Select a Fact table and a column to compare with the previously selected column {1-01 Revenue
(Sum All)} for calculation Click next.
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 13
- 14. 3.4). In new calculation window, Go to Generate New Calculations Select Change and Percentage
Change (If they are not appearing by default selected). Change the calculation name as you wishClick
Next.
3.5). In the next screen it will show a message that calculation wizard will create following calculations
Click on the Finish button to create two new calculated columns.
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 14
- 15. 3.6). Check out the new computed column created using calculation wizard automatically.
A business requirement needs to show result like below using this measure Chg 2-01 Billed
Qty(Sum All) and %Chg-01 Billed Qty(Sum All) based on dimensions for all months of a year.
Check out in OBI Answers using Gross Margin measure how this business requirement gets satisfied
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 15
- 16. Sql script generated by OBI Server for the requested report.
Example : #2
Quick Ratio: - This ratio is obtained by dividing the 'Total Assets' by 'Total Current Liabilities'.
Sometimes a company could be carrying heavy inventory as part of its current assets, which might be
obsolete or slow moving. Thus eliminating inventory from current assets and then doing the liquidity test
is measured by this ratio. It expresses the true 'working capital' relationship of its cash, accounts
receivables, prepaids and notes receivables available to meet the company's current obligations.
Follow Steps 2.2 to 2.6 to create Quick Ratio computed measure using existing logical columns.
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 16
- 17. A business requirement needs to show result like below using this measure Quick Ratio based on
dimensions for all months of a year.
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 17
- 18. Check into OBI Answers using Quick Ratio measure how this business requirement gets satisfied.
Sql script generated by OBI Server for the requested report.
Example#3
Gross Margin: - is the difference between selling price and cost. The purpose of margins is to determine
the value of incremental sales, and to guide pricing and promotion decision. Gross margin is the
difference between revenue (Pretax Income) and cost (Sales) before accounting for certain other costs.
Generally, it is calculated as the selling price of an item, less the cost of goods sold (production or
acquisition costs, essentially).
Follow Steps 2.2 to 2.6 to create Quick Ratio computed measure using existing logical columns
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 18
- 19. A business requirement needs to show result like below using this measure Gross Margin based on
dimensions for all months of a year
Check out in OBI Answers using Gross Margin measure how this business requirement gets satisfied.
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 19
- 20. Sql script generated by OBI Server for the requested report.
OBIEE 11g Beginners Guide | ©Business Intelligence Solution Providers 20