The MDX IIF function performs a conditional test, and returns an appropriate numeric expression or set depending on whether the test evaluates to true or false.
IIF ( search_condition, true_part, false_part )
An expression to evaluate as true or false (see MDX Grammar Rules).
A value_expression or a set. IIF returns this expression if the search condition evaluates to TRUE (something other than zero).
The value_expression can be a numeric value expression or a string value expression.
A value_expression or a set. IIF returns this expression if the search condition evaluates to FALSE (zero).
The value_expression can be a numeric value expression or a string value expression.
with
member measure.SSSSSS as sum({ (measure.XXX), (measure.YYY), (measure.ZZZ) })
member measure.XXX as ([measure].[sales amount]) * 10
member measure.YYY as ((measure.XXX) + 111)
member measure.ZZZ as (measure.YYY) / 8 - 222.22
member measure.QQQ as sum({([measure].[sales amount]), ([measure].[cash back])})
member Calendar.VVV as sum({ ([Calendar].[ALL].[2020]), ([Calendar].[ALL].[2019]) })
member measure.IIIIII as IIF( (measure.SSSSSS) > 2000000, 200, 404 )
select
{ (measure.SSSSSS), (measure.IIIIII) } on 0,
filter(members(Calendar), (((measure.SSSSSS) <= 30000) or ((measure.SSSSSS) >= 40000)) and (((measure.SSSSSS) <= 360000) or ((measure.SSSSSS) >= 370000))) on 1 from
[Online Store] ;
SSSSSS | IIIIII | |
ALL | 184887631.405 | 200 |
2020 | 183783502.655 | 200 |
Q1 | 91702.655 | 404 |
Q2 | 91702.655 | 404 |
Q3 | 91799902.655 | 200 |
M7 | 30599902.655 | 200 |
M8 | 30599902.655 | 200 |
M9 | 30599902.655 | 200 |
Q4 | 91799902.655 | 200 |
M10 | 30599902.655 | 200 |
M11 | 30599902.655 | 200 |
M12 | 30599902.655 | 200 |
2021 | 1104031.405 | 404 |
Q1 | 91702.655 | 404 |
Q2 | 91702.655 | 404 |
Q3 | 469272.655 | 404 |
M7 | 153710.155 | 404 |
M8 | 156281.405 | 404 |
M9 | 159086.405 | 404 |
Q4 | 451061.405 | 404 |
M10 | 154815.155 | 404 |
M11 | 151797.655 | 404 |
M12 | 144253.905 | 404 |