Other Relational Operators

Relational operators can be used with facts, metrics, or attributes to define filter conditions within a metric definition.

When defining filters with attributes, the unique numerical IDs of ordinal attribute values' can be extremely useful. Attribute value IDs are invisible to end users but knowledge of how they are applied can allow relational operator filters to be applied to certain attributes. For example, in the case of date values, attribute IDs are ordinal and chronological – so for the Month/Year attribute, the ID value of May 2007 is higher than the ID value for April 2007.

This allows you to refer to all months after May 2007 in the following way: Month/Year > May 2007.

Syntax

SELECT … WHERE … < …
SELECT metric WHERE fact1 < fact2
SELECT metric WHERE fact1 < number
SELECT metric1 WHERE metric2 < number
SELECT metric WHERE attribute < attribute_value

Examples

SELECT Number of Transactions WHERE Total_Amount > 10,000
SELECT Number_of_Transactions WHERE AMOUNT > 6 AND AMOUNT <= 20
SELECT Profit WHERE Month/Year < May 2007
SELECT Profit WHERE Year > 2007
SELECT Profit WHERE Date <= 12/22/2010
SELECT Profit WHERE Month of Quarter >= 2