MDX查询事实计数

时间:2019-01-09 02:26:54

标签: ssas mdx

我要使用MDX(Query)表达式作为命名集或下面的计算量度

Tsql:

当[car1,car2,car3,car4,car5]中的[product]。[Name]时,然后[Measure]。[Factcount] = 0 ELSE [Measure]。[Factcount] = 0

我在MDX以下尝试过

IIF({[product]。[Name]。&[car1], [产品]。[名称]。&[car2],[产品]。[名称]。&[car3],[产品]。[名称]。&[car4],[产品]。[名称]。&[car5 ]},[Measure]。[Factcount] = 0,[Measure]。[Factcount] = 1)

1 个答案:

答案 0 :(得分:0)

看看下面的示例

with member measures.test 
as 
case 
when [Product].[Subcategory].currentmember is [Product].[Subcategory].&[18] then 0
when [Product].[Subcategory].currentmember is [Product].[Subcategory].&[2] then 0
when [Product].[Subcategory].currentmember is [Product].[Subcategory].&[22] then 0
when [Product].[Subcategory].currentmember is [Product].[Subcategory].&[17] then 0
when [Product].[Subcategory].currentmember is [Product].[Subcategory].&[11] then 0
else 1 
end 
select measures.test 
on columns,
[Product].[Subcategory].[Subcategory]
on rows 
from 
[Adventure Works]