AddCalculatedMembers - MDX

AddCalculatedMembers

By default when we create calculated members we can not see them while resolving member of a set.



for example we have a [test] member in bucket which is sum of bucket 0 and 1.

WITH MEMBER [Bucket].[Bucket].[test]
AS
([Bucket].[Bucket].&[0]+[Bucket].[Bucket].&[1])

Now if we run the query

WITH MEMBER [Bucket].[Bucket].[test]
AS
([Bucket].[Bucket].&[0]+[Bucket].[Bucket].&[1])
SELECT
[Bucket].[Bucket].MEMBERS ON 0
FROM [Adventure Works]

Its not resolving calculated member test whiile returning member of a set [Bucket].

But if we add ADDCALCULATEDMEMBERS then we can see the newly created calculated member.

WITH MEMBER [Bucket].[Bucket].[test]
AS
([Bucket].[Bucket].&[0]+[Bucket].[Bucket].&[1])
SELECT
ADDCALCULATEDMEMBERS( [Bucket].[Bucket].MEMBERS )on 0
FROM [Adventure Works]



In measures there are number of caclulated members , to see all calculated members

SELECT ADDCALCULATEDMEMBERS([MEASURES].MEMBERS) ON 0
FROM [Adventure Works]

No comments:

Post a Comment

Popular Posts