Skip Headers

Oracle® OLAP DML Reference
10g Release 1 (10.1)

Part Number B10339-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

NONE

The NONE function returns YES when no values of a Boolean expression are TRUE. It returns NO when any value of the expression is TRUE.

Return Value

BOOLEAN

Syntax

NONE(boolean-expression [[STATUS] dimensions])

Arguments

boolean-expression

The Boolean expression to be evaluated.

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, NONE returns a single value. When you indicate one or more dimensions for the result, NONE 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 enables you to choose which relation is used when there is more than one.

Notes


NA Values

When the Boolean expression involves an NA value, NONE returns a YES or NO result when it can, as shown in the following table.

Boolean expression Result
NA EQ NA YES
NA NE NA NO
NA EQ non-NA NO
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, NONE returns NA. For example, when you test whether an NA value is greater than a non-NA value, NONE returns NA.


The Effect of NASKIP

NONE is affected by the NASKIP option. When NASKIP is set to YES (the default), NONE ignores NA values and returns YES when no value of the Boolean expression is TRUE and returns NO when any values are TRUE. When NASKIP is set to NO, NONE returns NA when any value of the expression is NA. When all the values of the expression are NA, NONE returns NA for either setting of NASKIP.


Data with a Time Dimension

When boolean-expression is dimensioned by a dimension of type DAY, WEEK, MONTH, QUARTER, or YEAR, you can specify any other DAY, WEEK, MONTH, QUARTER, or YEAR dimension as a related dimension. Oracle OLAP uses the implicit relation between the dimensions. To control the mapping of one DAY, WEEK, MONTH, QUARTER, or YEAR dimension to another (for example, from weeks to months), you can define an explicit relation between the two dimensions and specify the name of the relation as the dimension argument to the NONE function.

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.


The STATUS Keyword

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 NONE 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.


Related Statements

ANY, COUNT, and EVERY.

Examples

Example 18-34 Testing for No True Values by District

Suppose you want to find out which districts had no months in which sales fell below $50,000. Use the NONE function to determine whether the Boolean expression (SALES LT 50000) is TRUE for no months. To have the results dimensioned by district, specify district as the second argument to NONE.

LIMIT product TO 'Sportswear'
REPORT NONE(sales LT 50000, district)

The preceding statements produce the following output.

NONE(SALES
               LT 50000,
DISTRICT       DISTRICT)
-------------- ----------
Boston                 NO
Atlanta               YES
Chicago               YES
Dallas                YES
Denver                YES
Seattle                NO

Example 18-35 Testing for No True Values by Region

You might also want to find out which regions had no months in which no districts had sportswear sales of less than $50,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 NONE(sales LT 50000, region)

The preceding statement produces the following output.

NONE(SALES
               LT 50000,
REGION          REGION)
-------------- ----------
East                   NO
Central               YES
West                   NO