ssas - Checking Multiple condition in case statement using MDX query -
how write below case statement in mdx.i moved below mentioned columns in fact table.
sum(case when issummary = 1 , isaudited = 1 , finalauditflag = 1 1 else 0 end) auditscompleted,--count - completed audits
i tried below mdx query.
with member [measures].[count] ( case ([measures].currentmember ) when 0 ([measures].[is summary] ) else 1 end ) select {[measures].[count]} on 0, [dim_table1].[tableid].members on 1 [dsv]
what have done correct. change .currentmember
actual measure in cube. when have following referring i.e. currentmember
black arrow referring measure count
black arrow...
this in advwrks
:
select {[measures].[internet sales amount]} on 0 ,{[product].[product categories].[category]} on 1 [adventure works];
it returns this:
if want replace empty cell components can use case
:
with member [measures].[count] case [measures].[internet sales amount] when 0 "xxx" else [measures].[internet sales amount] end ,format_string = "#,###,##0" select { [measures].[count] } on 0 ,{[product].[product categories].[category]} on 1 [adventure works];
this returns this:
iif
used lot more in mdx
case
- iif
faster. above equivalent using iif
following:
with member [measures].[count] iif ( [measures].[internet sales amount] = 0 ,"xxx" ,[measures].[internet sales amount] ) ,format_string = "#,###,##0" select {[measures].[count]} on 0 ,{[product].[product categories].[category]} on 1 [adventure works];
Comments
Post a Comment