8-14 Metadata Repository Builders Guide for Oracle Business Intelligence Enterprise Edition
4.
In the Expression Builder - Derived logical column dialog, specify the expression from which the logical column should be derived.
5. Click OK.
Note that you can display data from multilingual database schemas by using Expression Builder to create a lookup function. For more information, see Supporting
Multilingual Data in Oracle Fusion Middleware System Administrators Guide for Oracle Business Intelligence Enterprise Edition.
Configuring Logical Columns for Multicurrency Support
You can configure logical columns so that Oracle Business Intelligence users can select the currency in which they prefer to view currency columns in analyses and
dashboards. You can set up this feature so that all users see the same static list of currency options, or you can provide a dynamic list of currency options that changes
based on a Logical SQL statement you specify.
To configure logical columns for multicurrency support: 1.
Create a session variable named PREFERRED_CURRENCY, along with an initialization block to use in the variable. Make sure to select Enable any user to
set the value when you create the session variable. Note that when you use
session variables in an expression for Oracle BI Presentation Services, you must preface their names with NQ_SESSION.
See Creating Session Variables
and Creating Initialization Blocks
for detailed information about setting up session variables and initialization blocks.
2. Edit any logical columns that display currency values to use the appropriate
conversion factor using the PREFERRED_CURRENCY session variable. To do this, double-click the appropriate logical column in the Business Model and Mapping
layer, select the Column Source tab, and create a derived expression that uses the PREFERRED_CURRENCY variable.
For example, the following logical column expression uses the value of the NQ_ SESSION.PREFERRED_CURRENCY variable to switch between different currency
columns. Note that the currency columns are expected to have the appropriate converted values.
INDEXCOL CASE VALUEOFNQ_SESSION.PREFERRED_CURRENCY WHEN gc1 THEN 0 WHEN gc2 THEN 1 WHEN orgc THEN 2 WHEN lc1 THEN 3 ELSE 4 END,
Paint.Sales Facts.USDCurrency, Paint.Sales Facts.DEMCurrency ,
Paint.Sales Facts.EuroCurrency , Paint.Sales Facts.JapCurrency ,
Paint.Sales Facts.USDCurrency
3. If you want to provide a dynamic list of currency options, create a table in your
data source that provides the entries you want to display for the user-preferred currency. This table must include the following columns:
Note: To optimize performance, do not define aggregations in
Expression Builder. Instead, use the Aggregation tab of the Logical Column dialog. See
Setting Default Levels of Aggregation for Measure Columns
for more information.
Working with Logical Tables, Joins, and Columns 8-15
■
The first column contains the values used to set the session variable PREFERRED_CURRENCY. Each value in this column is a string that uniquely
identifies the currency for example, gc2.
■
The second column contains currency tags from the file currencies.xml. The displayMessage values for each tag are used to populate the Currency box and
currency prompts for example, int:euro-1. The currencies.xml file is located in ORACLE_HOME\bifoundation\web\display.
■
You can optionally provide a third column that contains the values used to set the presentation variable currency.userPreference. Each value in this
column is a string that identifies the currency for example, Global Currency 2. If you omit this column, then the values for the displayMessage attributes
for the corresponding currency tags in the currencies.xml file are used.
Table 8–1 shows a sample table with user-preferred currency entries.
Additional configuration is required in Oracle BI Presentation Services to enable this feature. For full information about the Oracle BI Presentation Services configuration,
see Defining User-Preferred Currency Options in Oracle Fusion Middleware System Administrators Guide for Oracle Business Intelligence Enterprise Edition.
Setting Default Levels of Aggregation for Measure Columns
You need to specify aggregation rules for mapped logical columns that are measures. Aggregation should only be performed on measure columns, with the possible
exception of the aggregation COUNT and COUNTDISTINCT. Measure columns should exist only in logical fact tables.
You can optionally select different aggregation rules for different dimensions that are associated with this logical column. For example, if someone queries the aggregate
column along with one dimension, you may want to use one type of aggregation rule, whereas with another dimension, you may want to use a different aggregation rule.
When the default aggregation rule is Count Distinct, you can optionally specify an override aggregation expression for specific logical table sources. For example, you
may want to specify override aggregation expressions when you are querying different aggregate table sources that already contain some level of aggregation. If you
do not specify any override, then the default rule prevails.
You can choose the aggregation rule Evaluate_Aggr to enable queries to call custom functions in the data source. For information about this function and other aggregation
rules, see Appendix C
. See also Defining Aggregation Rules for Multidimensional
Data Sources for additional information about setting aggregation for
multidimensional sources. By default, data is considered sparse. However, on rare occasions you might have a
logical table source with dense data. A logical table source is considered to have dense
Table 8–1 Sample Table for Dynamically Displaying the Preferred Currency
UserPreference CurrencyTag
UserPreferenceName
char char
char orgc1
loc:en-BZ Org currency
gc2 int:euro-1
Global currency 2 lc1
int:DEM Ledger currency
gc1 int:USD
Global Currency 1
8-16 Metadata Repository Builders Guide for Oracle Business Intelligence Enterprise Edition
data if it has a row for every combination of its associated dimension levels. When setting up aggregate rules for a measure column, you can specify that data is dense
only if all the logical table sources to which it is mapped are dense.
To specify a default aggregation rule for a measure column: 1.
In the Business Model and Mapping layer, double-click a logical column.
2.
In the Logical Column dialog, click the Aggregation tab.
3.
In the Aggregation tab, choose one of the following options:
■
For measures in which the additivity is the same in all dimensions in other words, for fully-additive or non-additive measures, select one of the
aggregate functions from the Default Aggregation Rule list.
The function you select is always applied when a user or an application requests the column in a query, unless an override aggregation expression has
been specified.
When you select Count Distinct as the default aggregation rule, you can specify an override aggregation expression for specific logical table sources.
Choose this option when you have more than one logical table source mapped to a logical column and you want to apply a different aggregation rule to each
source.
Click the Add button to select logical table sources for which you want to specify individual aggregation rules. In the Browse dialog, select the logical
table source you want to add, and click OK. Then, in the Formula list for that logical table source, select the aggregation rule you want to use.
■
Select Based on dimensions if your measure has different additivity for different dimensions in other words, for semi-additive measures. For
example, select this option for inventory units that sum in all dimensions except time. See
Setting Up Dimension-Specific Aggregate Rules for Logical Columns
for more information about this feature.
Click the Add button to select additional dimensions for which you want to specify aggregation rules. In the Browse dialog, select the dimension you want
to add, and then click OK. Then, in the Formula list for that dimension, select the aggregation rule you want to use, or click the Expression Builder button
to build the aggregation rule using Expression Builder.
The Data is dense option appears when you select Based on dimensions. Select this option only if all the logical table sources to which this column is
mapped are dense.
4. Click OK.