Technical data

Using Built-in Functio ns in Analytic Models Chapter 11
FollowingisamoreusefulexampleoftheDAYfunction: supposeyoudefineadatacubecalled
DAILY_RECEIPTS that uses a dimension called DAYS. You w ant to calculate the average receipts for each day
of the month. In other words, you want to know the average receipts for the first day of each month, the average
receipts for the second day of each month, and so on. To do this, create a dimension called DAY_NUM that
contains members numbered 1 to 31. Then define a data cube called AVG_RECEIPTS_BY_DAY that uses the
DAY_NUM dimension. Finally, enter the following formula for the AVG_RECEIPTS_BY_DAY data cube:
DAVG(DAYS, DAILY_RECEIPTS, DAY( ) = MEMBER(DAY_NUM))
For each DAY_
NUM member in AVG_RECEIPTS_BY_DAY, the formula averages a ll DAILY_RECEIPTS
where the day
of the month equals the index of the DAY_NUM member. Thus, if the program is calculating
the fifth DAY
_NUM member for AVG_RECEIPTS_BY_DAY, it averages the receipts for the dates
2005/01/05,
2005/02/05, 2005/03/05, 2005/04/05, and so on, because these are the dates where the DAY( )
function re
turns 5.
See Also
Chapter 11, “Using Built-in Functions in Analytic Models,” D AVG, page 148 and Chapter 11, “Using Built-in
Functions i n Analytic Models,” MEMBER, page 172.
DCOUNT
Syntax
DCOUNT(Dimension, {Condition})
Description
The DCOUNT function returns the number of members in Dimension for which Condition is true. If Condition
is omitted, DCOUNT returns the number of members in Dimension.
Returns
The number o
fmembersinDimension for which Condition is true. If Condition is omitted, DCOUNT returns
the number
of members in Dimension.
Example
Suppose an analytic model contains a data cube called UNITS_SOLD that uses a dimension called PRODUCTS.
Use the following formula to find the number of products that sold more than 5000 units:
DCOUNT(PRODUCTS, UNITS_SOLD > 5000)
For an example of how to tabulate data for a series of ranges, see the entry for the DAVG function.
See Also
Chapter 11
, “Using Built-in Functions in Analytic Models,” DAVG, page 148
DDB
Syntax
DDB(Cost,
Salvage, Life, Period)
150 Copyright © 1988-2007, Oracl e. All rights reserved.