1

我试图从包含省和州的维度 [Ship To State] 中排除未知。

第一个表达式抛出了省和州,我不知道为什么 -

此 mdx 仅列出州(不包括未知,出于某种原因,不包括省):

WITH 
MEMBER measures.ParameterCaption as [Ship To].[Ship To State].currentmember.member_caption

MEMBER measures.ParameterValue as [Ship To].[Ship To State].currentmember.uniquename
SELECT {measures.ParameterCaption, measures.ParameterValue}  ON COLUMNS,
FILTER([Ship To].[Ship To State].children,

[Ship To].[Ship To State].currentmember<>[Ship To].[Ship To State].&[Unknown]

) ON ROWS
FROM [Invoiced Orders]

此 mdx 正确列出了州和省,并排除了未知:

WITH 
MEMBER measures.ParameterCaption as [Ship To].[Ship To State].currentmember.member_caption
MEMBER measures.ParameterValue as [Ship To].[Ship To State].currentmember.uniquename
SELECT {measures.ParameterCaption, measures.ParameterValue}  ON COLUMNS,
FILTER([Ship To].[Ship To State].children,

measures.ParameterCaption <> "Unknown"

) ON ROWS
FROM [Invoiced Orders]
4

1 回答 1

2

如果您的比较是已知成员(或一组成员),例如您的示例,您可以使用该Except()函数直接将其从集合中删除。

Except(
    [Ship To].[Ship To State].children,
    {[Ship To].[Ship To State].&[Unknown]}
)

此处的文档:http: //msdn.microsoft.com/en-us/library/ms144900.aspx

于 2013-05-23T01:24:06.940 回答