I am trying to count rows(Postal codes per State) using a sub query... Please help me to understand the following behavior. MDX:
WITH
SET [rows] AS
{[Customer].[Postal Code].members}
MEMBER [Measures].[RowsCount] AS
Count
(
[rows]
)
MEMBER [Measures].[RowsCount1] AS
Count
(
{[Customer].[Postal Code].members}
)
SELECT
{
[Measures].[RowsCount]
,[Measures].[RowsCount1]
} ON columns
FROM
(
SELECT
(
{[Customer].[State Province Name].&[Hamburg]}
) ON Columns
FROM [Analysis Services Tutorial]
)
- Why [Measures].[RowsCount] and [Measures].[RowsCount1] return different results although both use the same set: "{[Customer].[Postal Code].members}")?
- Only [Measures].[RowsCount] returns a correct/expected result, but my goal is to avoid the "WITH SET" definition, and use only the [Measures].[RowsCount1] inline, which should return a correct result.
EDIT
The following statement would be a solution:
MEMBER [Measures].[RowsCount1] AS
Count
(
{[Customer].[Postal Code].members} * {[Customer].[State Province Name].&[Hamburg]}
)
however I would like to achieve it by using a CurrentMember
function, something like this (does not work):
MEMBER [Measures].[RowsCount1] AS
Count
(
{[Customer].[Postal Code].members} * {[Customer].[State Province Name].CurrentMember}
)