Previous
Previous
 
Next
Next

Comparing Dimension Values

Values are not compared in the same dimension based on their textual values. Instead, Oracle OLAP compares the positions of the values in the default status of the dimension. This enables you to specify statements like the following statement.

REPORT district LT 'Seattle'

Statements are interpreted such as these using the following process:

  1. The text literal 'Seattle' is converted to its position in the district default status list of the dimension.

  2. That position is compared to the position of all other values in the district dimension.

  3. As shown by the following report, the value YES is returned for districts that are positioned before Seattle in the district default status list of the dimension, and NO for Seattle itself.

    REPORT 22 WIDTH district LT 'Seattle'
    
    District       DISTRICT LT 'Seattle'
    -------------- ----------------------
    Boston                            YES
    Atlanta                           YES
    Chicago                           YES
    Dallas                            YES
    Denver                            YES
    Seattle                            NO
    

A more complex example assigns increasing values to the variable quota based on initial values assigned to the first six months. The comparison depends on the position of the values in the month dimension. Because it is a time dimension, the values are in chronological order.

quota = IF month LE 'Jun02' THEN 100 ELSE LAG(quota, 1, month)* 1.15

However, when you compare values from different dimensions, such as in the expression region lt district, then the only common denominator is TEXT, and text values are compared, not dimension positions.