Using Logical Columns Goal To derive a new calculation based on existing business measures Scenario You want to enable users to track the difference between the units ordered and units shipped by selecting a single fact column called Cut s. This business measure can potentially help track lost revenue. You use the Expression Builder to configure a formula for Cut s using existing logical columns as objects in the formula. Outcome In the Business Model and Mapping layer, the Cut s logical column is added to the Sal esFact s logical table. In the Presentation layer, the Cut s presentation column is added to the Sal esFact s presentation table. Time 1015 minutes Instructions 1. Because you modify the ABC repository in online mode in this practice, ensure that the Oracle BI Server service is started. 2. In this step, you start the Administration Tool and open the ABC repository in online mode. Up to this point, all the changes you have made to the repository have been in offline mode. Now that you have a consistent repository and Oracle BI Server is running and using it, you can make changes to the metadata in online mode.
Offline, the relationship between the Administration Tool and the repository is similar to the relationship between any Windows application and a file: an application, the Administration Tool in this case, opens a file for editing, makes changes to its in-memory copy, and tells the OS to save the changed file.
In online mode, the relationship is different. Oracle BI Server has already opened the repository file and the operating system has put a write-lock on the file. In this mode, Oracle BI Server can act as an agent of the Administration Tool. When the Administration Tool tells it to, Oracle BI Server sends the Administration Tool a copy of its in-memory repository. Then it listens for messages from the Administration Tool about changes, makes those changes to its in-memory copy, and, when told by the Administration Tool, tells the OS to save the changed file. RR I-TEC,,#209,Ni lagiri Block, Adithya Enclave @8801408841, 8790998182
When you start the Administration Tool in online mode, you pick an Oracle BI ODBC DSN that points to the repository you want to edit (the repository that is the default repository in the DSN). The Administration Tool then communicates changes to Oracle BI Server and Oracle BI Server makes the corresponding changes to its in-memory copy. a. Select Start > Programs > Oracle Business Intelligence > Administration. b. Select File > Open > Online. c. In the Open Online Analytics Web dialog box, log in as Administrator; no password needed. d. Ensure that the title bar displays (Online) indicating you are in online mode. 3. In this step, you set a user preference to check out objects automatically. Because Oracle BI Server may be processing queries while you are editing the repository, you must check out objects before editing them. After the objects have been edited, you check them in again. Then the changes you made become active. When you have finished editing, you can save the changes to the repository. a. Select Tools > Options. b. Select the General tab. c. Make sure that Check out objects automatically is selected. d. Click OK. 4. In this step, you define a new logical measure called Cuts (the difference between what was ordered and what was shipped) in the SalesFacts logical table, using existing logical columns to define the calculation formula. a. In the Business Model and Mapping layer, right-click the SalesFacts logical table and select New Object > Logical Column. b. Ensure that the General tab is selected. c. Enter Cuts in the Name field to name the column. d. Select the Use existing logical columns as the source check box. e. To open the Expression Builder, click the Ellipsis button (to the right of the text edit box). f. In the left pane of the Expression Builder, select the Logical Tables folder. g. In the middle pane, select the SalesFacts logical table. h. In the Search field under the right pane, enter the letter U. This narrows the list of objects in the pick list. This is a useful feature in large repositories. i. In the right pane, select the Units Ordered logical column. j. Click Insert. k. Click the minus sign on the toolbar. l. In the right pane, double-click the Units Shipped logical column to insert it in the formula. RR I-TEC,,#209,Ni lagiri Block, Adithya Enclave @8801408841, 8790998182
m. Check your results:
n. Click OK to close the Expression Builder. Note that the expression is now displayed in the Logical Column dialog box. o. Select the Data Type tab. The data type of logical columns derives from the data types of the underlying physical columns. The Administration Tool examines the data types of the physical sources and selects the most inclusive data type for the logical column. Data types may be changed by the formula you create. For example, consider a logical column that is defined as ColumnA * ColumnB. If ColumnA and ColumnB are integers, then the product of those two columns is also an integer. If the formula was 1.0 * ColumnA * ColumnB instead, the resulting data type would be a DOUBLE. The data type transformation happens in left to right order within the normal order of operations. If the data were from SQL Server (which has an Integer data type) and both UNI TORDD and UNI TSHPD were integers, Cuts would have an I NT data type instead of DOUBLE. Note also that the formula is expressed in terms of the physical column data types and that it also includes the aggregation functions (sum).
p. Click OK. Note that the icon for Cut s is blue and that all other logical columns in the Sal esFact s logical table have a check mark. This indicates that the logical columns have not yet been checked in to the server. 5. Add the new Cut s column to the SupplierSales presentation catalog. RR I-TEC,,#209,Ni lagiri Block, Adithya Enclave @8801408841, 8790998182
a. In the Presentation layer, ensure that the SupplierSales presentation catalog is expanded. b. Select Cuts from the Sal esFact s logical table and drag it onto the SalesFacts presentation table. 6. Select File > Check In Changes or click the Check In Changes button on the toolbar. 7. Click Yes to check global consistency. Fix errors, if any, before proceeding. 8. If the repository passes the consistency check, close the Consistency Check Manager. 9. Save the repository. 10. Check your work. a. Log in to Oracle BI Presentation Services as Administrator; no password is needed. b. Click the Answers link and the SupplierSales subject area. c. Click Reload Server Metadata. d. Create the following request:
f. Ensure that the Cut s calculation is accurate for the Frozen food type by manually subtracting Units Shipped from Units Ordered. g. Is the value in the Cut s column for the Frozen food type accurate?
h. Ensure that the Cut s calculation is accurate for the Lamb food type by manually subtracting Uni t s Shi pped from Uni t s Or der ed. i. Is the value in the Cut s column for the Lamb food type accurate?
j. Leave Answers open. 11. Examine the query log to see what query was sent to the database. RR I-TEC,,#209,Ni lagiri Block, Adithya Enclave @8801408841, 8790998182
a. Select Settings > Administration > Manage Sessions > View Log to open the query log. What you see should be similar to the following:
b. Note that Cuts is included in the logical query.
c. Note that the difference between units ordered and units shipped is being calculated in the outer query block (D1.c1 - D1.c2 as c4 here). Because you defined the Cut s calculation using logical columns, the columns are summed first and then the difference is calculated. You compare these results to the query results in the next practice. d. Close the query log. e. Leave Answers open. f. What would happen if you deleted a logical column that is used to define the formula of another logical column? The derived column would not be deleted automatically. However, the tool would display an icon that warns you about this condition. Dont do this! This is just for informational purposes. RR I-TEC,,#209,Ni lagiri Block, Adithya Enclave @8801408841, 8790998182
Solutions 7-1: Creating Calculation Measures by Using Logical Columns Answers 10.g. Is the value in the Cut s column for the Frozen food type accurate? Yes, 0 is the correct value. 10.i. Is the value in the Cut s column for the Lamb food type accurate? Yes, 39 is the correct value. RR I-TEC,,#209,Ni lagiri Block, Adithya Enclave @8801408841, 8790998182
Practice 7-2: Creating Calculation Measures by Using Physical Columns Goals To modify a repository in online mode and create a calculation measure using physical columns Scenario You want users to be able to track the difference between the units ordered and units shipped by selecting a single fact column called Cut sP. In the previous practice, you used logical columns to create the calculation. In this practice, you use the Expression Builder again to configure a formula for Cut sP using physical columns as objects in the formula. Outcome In the Business Model and Mapping layer, Cut sP is added to the Sal esFact s logical table. In the Presentation layer, Cut sP is added to the Sal esFact s presentation table. Time 1015 minutes Instructions 1. Return to the ABC repository, which should still be open in online mode. 2. Configure a new logical column in the Sal esFact s logical table that uses physical columns in its formula. a. In the Business Model layer, right-click the SalesFacts table and select New Object > Logical Column. b. Enter CutsP in the Name field to name the column. c. Select the Aggregation tab. d. In the Default aggregation rule field, select Sum. e. Click OK. 3. Map the new Cut sP column to a physical source. a. In the Business Model and Mapping layer, expand the Sources folder for the Sal esFact s table and double-click D1_ORDERS2. b. Select the Column Mapping tab. c. If necessary, select the Show unmapped columns check box to display the Cut sP logical column. RR I-TEC,,#209,Ni lagiri Block, Adithya Enclave @8801408841, 8790998182
d. To open the Expression Builder, click the Expression Builder button (. . .) next to Cut sP. e. In the left pane of the Expression Builder, select the Physical Tables folder. f. In the middle pane, select the D1_ORDERS2 table. g. Following the process used in the previous practice, create a formula that subtracts units shipped from units ordered using physical columns. Check your results:
h. Click OK to close the Expression Builder. i. Note that you can see the formula in the Expression column for Cut sP on the Column Mapping tab. You may need to adjust the column width to see the entire formula. j. Click OK to close the Logical Table Source properties dialog box. k. Double-click the CutsP logical column. l. Click the General tab and note that Cut sP is not defined using existing logical columns as the source. m. Click the Data Type tab and note the data type of the logical column based on its formula definition and the data types of the sources. Note also that formula finds the difference between the columns first and then sums the difference. n. Click OK to close the Logical Column properties dialog box. o. Select CutsP in the Sal esFact s logical table and drag it onto the SalesFacts presentation table in the Presentation layer. 4. Check in the changes made to the repository: a. Select File > Check In Changes or click the Check In Changes button on the toolbar. b. Click Yes when asked to check consistency. Fix errors, if any, before proceeding. c. If the repository is consistent, close the Consistency Check Manager. 5. Save the repository. 6. Reload the server metadata in Answers. a. Return to Answers. b. Click the Reload Server Metadata link to update the repository. c. Ensure that CutsP appears in the Sal esFact presentation table.
7. Check your work. a. Create the following request:
b. Click the Results tab to view the results.
c. Ensure that the Cut sP calculation is accurate for the Frozen food type by manually subtracting Units Shipped from Units Ordered. Is the value in the Cut sP column accurate?
d. Ensure that the Cut sP calculation is accurate for the Lamb food type by manually subtracting Units Shipped from Units Ordered. Is the value in the Cut sP column accurate?
8. Examine the query log to see what query was sent to the database: RR I-TEC,,#209,Ni lagiri Block, Adithya Enclave @8801408841, 8790998182
a. Open the query log. Your results should resemble the following screenshot:
b. Note that CutsP is included in the logical query. c. Note also that the difference between units ordered and units shipped is calculated first and then summed (sum(T285.UNITORDD - T285.UNITSHPD) as c4 in the example here). Compare these results with the query results in the previous practice. d. Close the query log. e. Leave Answers open. f. What are the advantages and disadvantages of defining a logical column in terms of other logical columns, rather than in terms of the physical sources directly? The advantage of defining a logical column formula based on existing logical columns is that you have to define it only once. When you create formulas based on physical columns, you have to map for each physical source it could be derived from. Sometimes, you have no choice, however, if you have to use physical columns to apply an aggregation rule after a calculation. RR I-TEC,,#209,Ni lagiri Block, Adithya Enclave @8801408841, 8790998182
Solutions 7-2: Creating Calculation Measures by Using Physical Columns Answers 7.c. Ensure that the Cut sP calculation is accurate for the Frozen food type by manually subtracting Units Shipped from Units Ordered. Is the value in the Cut sP column accurate? Yes, 0 is the correct value.
7.d. Ensure that the Cut sP calculation is accurate for the Lamb food type by manually subtracting Units Shipped from Units Ordered. Is the value in the Cut sP column accurate? Yes, 39 is the correct value. RR I-TEC,,#209,Ni lagiri Block, Adithya Enclave @8801408841, 8790998182
Practice 7-3: Creating Calculation Measures by Using the Calculation Wizard Goals To modify a repository in offline mode and create calculation measures using the Calculation Wizard Scenario You want to model two calculation measures using the Calculation Wizard, called Change Units Shipped and Percent Change Units Shipped. The Change Units Shipped measure calculates the difference between the units ordered and units shipped. The Percent Change Units Shipped measure calculates what percentage of the units ordered has not been shipped. The calculation measures that are created by the wizard are based on existing logical columns. You rename these columns Cut sWand Per cent Not Shi pped in the Presentation layer. Outcome In the Business Model and Mapping layer, Change Units Shipped and Percent Change Units Shipped are added to the Sal esFact s logical table. In the Presentation layer, CutsW and Percent Not Shipped are added to the Sal esFact s presentation table. Time 1015 minutes Instructions 1. Return to the ABC repository, which should still be open in online mode. 2. In this step, you model two calculation measures using the Calculation Wizard. a. In the Business Model and Mapping layer, expand the SalesFacts table. b. Right-click the Units Ordered column and select Calculation Wizard. c. In the Calculation Wizard Introduction dialog box, click Next. d. In the Choose columns pane, SalesFacts is selected. The columns appear in the right pane. e. Select the Units Shipped check box. f. Click Next. g. In the Generate Calculations section, ensure that the Change and Percent Change check boxes are both selected. RR I-TEC,,#209,Ni lagiri Block, Adithya Enclave @8801408841, 8790998182
h. In the Generate Calculations section, ensure that Change is highlighted.
i. In the Calculation Name field, enter CutsW. j. Note the results that are returned when Units Shipped is NULL:
k. In the Generate Calculations section, select Percent Change so that it is highlighted.
l. Change the Calculation Name to Percent Not Shipped. m. Note the results that are returned when Units Shipped is not available (NULL) or is zero using the following parameters. The screenshot shows only partial results:
n. Click Next to open the Check Out Objects window. o. Review the objects that must be checked out. p. Click Next. q. Review the two calculations measures that will be created by the Wizard: CutsW and Percent Not Shipped. r. Click Finish. RR I-TEC,,#209,Ni lagiri Block, Adithya Enclave @8801408841, 8790998182
s. In the Business Model and Mapping layer, ensure that there are two new columns created by the Calculation Wizard in the Sal esFact s table.
t. Drag the new CutsW and Percent Not Shipped logical columns from the Sal esFact s logical table onto the SalesFacts presentation table in the SupplierSales presentation catalog in the Presentation layer. 3. Check in changes. 4. Check global consistency. 5. If the repository is consistent, close the Consistency Check Manager. If not, fix any errors before proceeding. 6. Save the repository. 7. Return to Answers. 8. Reload Server Metadata. 9. Create the following request:
10. Format the Percent Not Shipped column to display percentages. a. In the Percent Not Shipped column, click the Column Properties button . b. Click the Data Format tab. c. Select the Override Default Data Format check box. d. In the Treat Numbers As drop-down list, select Percentage. e. In the Decimal Places drop-down list, select 2. f. Save these settings as the system-wide default for Percent Not Shipped. RR I-TEC,,#209,Ni lagiri Block, Adithya Enclave @8801408841, 8790998182
g. Check your changes:
h. Click OK to close the Column Properties dialog box. RR I-TEC,,#209,Ni lagiri Block, Adithya Enclave @8801408841, 8790998182
11. Click Results.
12. Ensure that the Cut sWcalculation is accurate for the Frozen food type by manually subtracting Units Shipped from Units Ordered. Is the value in the Cut sWcolumn accurate?
13. Ensure that the Cut sWcalculation is accurate for the Lamb food type by manually subtracting Units Shipped from Units Ordered. Is the value in the Cut sWcolumn accurate?
14. To ensure that the Percent Not Shipped value is accurate, you divide Cut sWby Uni t s Shi pped. For example, for the Lamb food type, you divide 39 by 961 to get 4.06. This tells you that 4.06% of the units ordered have not been shipped. RR I-TEC,,#209,Ni lagiri Block, Adithya Enclave @8801408841, 8790998182
15. Examine the query log to see what query was sent to the database. Your query results should resemble the following screenshot:
a. Note that the CutsW and Percent Not Shipped columns are listed in the logical query.
b. Also, note that the parameters you specified for NULL values are included.
c. Close the log file. d. Leave Answers and the Administration Tool open for the next practice. RR I-TEC,,#209,Ni lagiri Block, Adithya Enclave @8801408841, 8790998182
Solutions 7-3: Creating Calculation Measures by Using the Calculation Wizard Answers 12. Ensure that the Cut sWcalculation is accurate for the Frozen food type by manually subtracting Units Shipped from Units Ordered. Is the value in the Cut sWcolumn accurate? Yes, 0 is the correct value. 13. Ensure that the Cut sWcalculation is accurate for the Lamb food type by manually subtracting Units Shipped from Units Ordered. Is the value in the Cut sWcolumn accurate? Yes, 39 is the correct value. RR I-TEC,,#209,Ni lagiri Block, Adithya Enclave @8801408841, 8790998182