I have an urgent problem with some queries including calculated members where I want to filter by properties..
I have rewriten my query to show my issue on the Adventure Works Database.
Code Snippet
with
member [Account].[Accounts].[TEST] as 0
/* create a new query calculated member in the hierarchy */
select
{} on columns,
{
filter(
{
descendants([Account].[Accounts].&[1], 2)
,[Account].[Accounts].[TEST]
/* use the new calculated member */
/* comment out the calc member to see successfull execution */
},
[Account].[Accounts].CurrentMember.Properties("Account Type")="Assets"
/* filter by a member property which does not exists on the query calculated member - error */
)
}
dimension properties
[Account].[Accounts].[Account Type],
[Account].[Accounts].[Account Number],
[Account].[Accounts].[Accounts]
on rows
from
[Adventure Works]
I create a calcuated meber - and then I want to use this in a filter by member property. The Server always raises the error that the property does not exists.
How to solve this error?
The Documentation http://technet.microsoft.com/en-us/library/ms146017.aspx specify a possiblity to specify the property for the member - but I was not able to this - like documented It has no effect.
I need some urgent Help, HANNES
If you want filter to remove the calculated member then use stripcalculatedmembers function to remove all calculated members from the 1st argument. If you want filter to retain the calculated member then use the iserror function like below:
with
member [Account].[Accounts].[TEST] as 0
/* create a new query calculated member in the hierarchy */
select
{} on columns,
{
filter(
{
descendants([Account].[Accounts].&[1], 2)
,[Account].[Accounts].[TEST]
},
iserror([Account].[Accounts].CurrentMember.Properties("Account Type")) or [Account].[Accounts].CurrentMember.Properties("Account Type")="Assets"
/* filter by a member property which does not exists on the query calculated member - error */
)
}
dimension properties
[Account].[Accounts].[Account Type],
[Account].[Accounts].[Account Number],
[Account].[Accounts].[Accounts]
on rows
from
[Adventure Works]
|||Hi,
my question - how do I proper specify a mdx property in the query calculated member.
I do not want to catch errors - nor produce errors - howto specifiy the property value in the query.
The documentation at http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2126305&SiteID=1 mentions a syntax, but I can not get it work.
If I properly read the doc I would write it like
Code Snippet
with
member [Account].[Accounts].[TEST] as 0 ([Account].[Accounts].[Account Type]="Assets")
/* create a new query calculated member in the hierarchy */
select
But it dos not work.
Any ideas howto write?
HANNES
|||Calculated members don't support custom member properties. The document you mentioned shows you how to use pre-defined member properties, such as FORMAT_STRING, for calculated members.
No comments:
Post a Comment