Beruflich Dokumente
Kultur Dokumente
Skip Headers
View PDF
Previous Next
ANY
The ANY function returns YES when any values of a Boolean expression are TRUE, or NO when none of
the values of the expression are TRUE.
Return Value
BOOLEAN.
Syntax
Arguments
boolean-expression
STATUS
Can be specified when one or more of the dimensions of the result of the function are not
dimensions of the Boolean expression. (See the description of the dimensions argument.) When you
specify the STATUS keyword when this is not the case, Oracle OLAP produces an error.
In cases where one or more of the dimensions of the result of the function are not dimensions of the
Boolean expression, the STATUS keyword might be required in order for Oracle OLAP to process
the function successfully, or the STATUS keyword might provide a performance enhancement. See
"The STATUS Keyword".
dimensions
The dimensions of the result. By default, ANY returns a single YES or NO value. When you indicate
one or more dimensions for the result, ANY tests for TRUE values along the dimensions that are
specified and returns an array of values. Each dimension must be either a dimension of boolean-
expression or related to one of its dimensions. When it is a related dimension, you can specify the
name of the relation instead of the dimension name. This makes it possible for you to choose which
relation is used when there is more than one.
Notes
NA Values
When the Boolean expression involves an NA value, ANY returns a YES or NO result when it can, as shown
1 of 3 9/2/2009 5:06 PM
ANY http://stanford.edu/dept/itss/docs/oracle/10g/olap.101/b10339/x_agmap...
NA NE non-NA YES
NA AND NO NO
NA OR YES YES
However, in cases where a YES or NO result would be misleading, ANY returns NA. For example, when you
test whether an NA value is greater than a non-NA value, ANY returns NA.
ANY is affected by the NASKIP option. When NASKIP is set to YES (the default), ANY ignores NA
values and returns YES when any of the values of the expression that are not NA are TRUE and returns NO
when none of the values are TRUE. When NASKIP is set to NO, ANY returns NA when any value of the
expression is NA. When all the values of the expression are NA, ANY returns NA for either setting of
NASKIP.
For each time period in the related dimension, Oracle OLAP tests the data values for all the source time
periods that end in the target time period. This method is used regardless of which dimension has the more
aggregate time periods.
When one or more of the dimensions of the result of the function are not dimensions of the Boolean
expression, Oracle OLAP creates a temporary variable to use while processing the function. When you
specify the STATUS keyword, Oracle OLAP uses the current status instead of the default status of the
related dimensions for calculating the size of this temporary variable.
When the size of the temporary variable for the results of the function would exceed 2 gigabytes, you
must specify the STATUS keyword in order for Oracle OLAP to execute the function successfully. When
the dimensions of the Boolean expression are limited to a few values and are physically fragmented, you
can specify the STATUS keyword to improve the performance of the function.
When you use the ANY function with the STATUS keyword in an expression that requires going outside
of the status for results (for example, with the LEAD or LAG functions or with a qualified data
reference), the results outside of the status will be returned as NA.
2 of 3 9/2/2009 5:06 PM
ANY http://stanford.edu/dept/itss/docs/oracle/10g/olap.101/b10339/x_agmap...
Related Statements
Examples
Suppose you want to find out which districts had at least one month with sales greater than $150,000 for
sportswear. You use the ANY function to determine whether the Boolean expression (sales GT 150000)
is TRUE for any month. To have the result dimensioned by district, specify district as the second
argument in the ANY function.
LIMIT product TO 'SPORTSWEAR'
REPORT HEADING 'High Sales' ANY(sales GT 150000, district)
You might also want to find out which regions had at least one month in which at least one district had
sportswear sales greater than $150,000. Since the region dimension is related to the district dimension,
you can specify region instead of district as a dimension for the results of ANY.
report heading 'High Sales' any(sales gt 150000, region)
3 of 3 9/2/2009 5:06 PM