使用以下 mdx,如果我在有或没有 where 子句的情况下运行它,结果是相同的:它返回层次结构中年份的总 nbr。
with member nbYears as [Time].[Year].[Year].count
select nbYears on 0
from [Sales]
where [Time].[2007]
您可以使用现有的 MDX 函数
WITH
member nbYears as (Existing [Time].[Year].[Year]).count
SELECT nbYears on 0
FROM [Sales]
WHERE [Time].[2007]