Databases Reference
In-Depth Information
Avg (
iif ( condition , LastPeriods (3), LastPeriods
(4)), [Measures].[Units]
[Measures].[Units]
)
AS2005 allows iif () to return other kinds of things as well. For example, you
can select the members from a level determined dynamically with the follow-
ing:
SELECT
IIF ( condition ,
[Customer].[Customer].[Region],
[Customer].[Customer].[State]
).Members on axis (1) ...
This function evaluates search_condition , which can be any value ex-
pression in AS 2005 and any logical or numeric expression in AS 2000. If
the result is true, or at least nonzero in Analysis Services, then the
true_part expression is evaluated and returned. If the result is not true,
then the false_part expression is evaluated and returned. The standard
version of the iif () function can either take numerical expressions for the
true part and the false part and return a number, or it can take string ex-
pressions for the true part and the false part and return a string. Microsoft
extends this to allow the parts to be numeric or string separately from
each other.
Note that when the search condition contains a logical expression that in-
volves comparison operations, since NULL cells compare as equal to
zero with any comparison operator, the result of the search condition
cannot be NULL. However, either the true_part or the false_part may
evaluate to NULL, in which case NULL will be the result when that condi-
tion is met.
See also: CoalesceEmpty (), Filter (), CASE
Intersect ( set1 , set2 [,ALL]) Returns: Standard
The ALL flag controls whether duplicates are retained or eliminated. When
ALL is not specified, only the unique tuples appearing in set1 that also appear
in set2 are returned. When ALL is specified, then duplicated tuples in set1
Search WWH ::




Custom Search