Databases Reference
In-Depth Information
expr1 OR expr2 Returns: Boolean Standard
The OR operator returns true if either expr1 is true or expr2 is true. In Analys-
is Services, if expr1 evaluates to true, then expr2 is not evaluated (because
the result is already guaranteed to be true).
See also: AND, NOT, XOR, iif (), Filter ()
Order ( set , { string_expression | numeric_expression } [,ASC | DESC | BASC |
BDESC]) Returns: set
Standard
Order () returns the set that it is given after it sorts it based on the given ex-
pression. If a numeric or string value expression is provided, then that is used
to sort the tuples; otherwise, the values of the cells in context are used. This
function also takes an optional flag to indicate how to sort. The default order-
ing is ASC (ascending without breaking the hierarchy).
Order () has two modes for sorting: breaking hierarchy and preserving hier-
archy. The BASC and BDESC options break the hierarchy, while ASC and
DESC do not. When the hierarchy is broken, the values associated with each
tuple in the set are treated as peers, and the set is ordered only by the val-
ues. When the hierarchy is preserved, a more complex ordering algorithm is
used, which can lead to very useful results.
Note that there is no explicit way to sort a set based on more than one cri-
terion. For example, if you want to sort a set based primarily on a string mem-
ber property and secondarily on a numerical value, no good way is available
for specifying this.
Preserving Hierarchy: Set Containing One Dimension
When the set consists only of one dimension's worth of members, sorting and
preserving the hierarchy orders each parent before its children. At each level
of members from the top down, the children of each parent are sorted relative
to each other. For example, the product hierarchy for a fictional fishcake man-
ufacturer is shown in Figure A-28 and the units shipped per product are
shown in Figure A-29 . Ordering these members while preserving the hier-
archy would give us the orderings shown in Figure A-30 .
 
Search WWH ::




Custom Search