Technical data

Chapter 10 Creating Rules, Formulas, and User Functions
Filter User Fun
ctions
You a pply a filter user function to a specific dimension, on the Dimensions tab of the cube collection’s
properties.
See C
hapter 7, “Creating Cube Collections,” Defining Additional Cube Collection Dimension Propertie s,
page 60.
This section p
rovides o verviews of:
Data filters.
Dimension member filters.
Data Filters
You can create
filter user functions to display only the dimension members whose values meet a certain
condition. Fo
r example, this is the formula for the FILTER_PROD_OVER_2000 filter user function, which is
appliedtothe
PRODUCTS dimension:
IF (SALES > 200
0, RETURN(1), RETURN(0))
In the analytic model, only the PRODUCTS dimension is attached to the SALES data cube. In the analytic grid,
the end user views the SALES data cube but only has access to the products that have sold over 2000 units.
Here is the formula for the FILTER_RED_PRODUCTS filter user function, which is applied to the
PRODUCTS dimension:
IF(PRODUCT_COLOR = "RED", RETURN(1), RETURN(0))
In this example, the end user only has access to the products whose members have the red attribute.
When a filter
user function is applied to a dimension that is attached to a multidimensional data cube, the
end user has a
ccess to a different set of members depending on whether the filtered dimension is in the
column axis/
rowaxisorslicebar.
Using the first filter user function example, the PRODUCTS, MONTHS and REGIONS dimensions are
attached to the SALES data cube. When only the PRODUCTS dimension is in the column or row axis—and
the other dimensions are in the slice bar—the end user has access to only the PRODUCTS members that have
sold over 2000 units in the c urrently selected region and month in the slice bar. If the end user changes the
region or month selection in the slice bar, the filter is reapplied and the analytic grid may display a different
set of PRODUCTS members.
However—when the PRODUCTS dimension plus one or more d imensions are in the slice bar—the end user
has access to a different set of dimension members. For example:
•IfthePRODU
CTS dimension is in the slice bar, the end user has access to all PRODUCTS members that
have sold o
ver 2000 units in all r egions over the course of all months, regardless of where these dimensions
are displa
yed in the grid.
•IfthePROD
UCTS dimension is in the row headings, the MONTHS dimension is in the column headings
and the REG
ION dimension is in the slice bar, the end user has access to all P RODUCTS members that have
sold over 2
000 units in the currently selected region in the slice bar, over the course of all months.
•IfthePROD
UCTS and MONTHS dimensions are in the row headings—and the MONTHS dimension is
indented b
elow the PRODUCTS dimension—plus the REGION dimension is in the slice bar, the end user
has access
to all PRODUCTS members that have sold over 2000 units in the currently selected region in
the slice
bar, for the month under which the products are displayed. This means that the analytic grid may
display a
different set of products for each month.
Copyright © 1988-2007, Oracl e. All rights reserved. 113