dbTalk Databases Forums  

MDX function to return the name of a Calculated Member?

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss MDX function to return the name of a Calculated Member? in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Koan B
 
Posts: n/a

Default MDX function to return the name of a Calculated Member? - 11-10-2004 , 10:11 AM






Hi,

I need to find a way to identify a particular calculated member, but
the .Name or .UniqueName functions don't appear to be an option;
execute the following query in FoodMart 2000 to see what I mean:

WITH MEMBER [Store].[Name] AS '
[Measures].CurrentMember.Name
'
MEMBER [Store].[UniqueName] AS '
[Measures].CurrentMember.UniqueName
'
SELECT [Measures].AllMembers ON COLUMNS,
{[Store].[Name], [Store].[UniqueName]} ON ROWS
FROM [HR]

You'll see the name and unique name property displayed for the actual
measures in the HR cube, but #ERR for the calculated member [Avg
Salary]. Anyone know of a way I can determine the name of calculated
members as well?

Cheers,
Koan

Reply With Quote
  #2  
Old   
Chris Webb
 
Posts: n/a

Default RE: MDX function to return the name of a Calculated Member? - 11-10-2004 , 11:03 AM






Hi Koan,

Your MDX here is correct - you do indeed need to use the .NAME or
..UNIQUENAME functions. The reason you got ERRs in your query is because you
didn't set a solve order on the two calculated members you created, so they
were evaluated before the Avg Salary calculated measure; that calc was trying
to do a division operation on the text values they returned. You can see the
error message in MDX Sample app by double-clicking on the cells with ERR in.

To fix this, try the following query:
WITH MEMBER [Store].[Name] AS ' [Measures].CurrentMember.Name ' ,
solve_order=100
MEMBER [Store].[UniqueName] AS ' [Measures].CurrentMember.UniqueName ' ,
solve_order=100
SELECT [Measures].AllMembers ON COLUMNS, {[Store].[Name],
[Store].[UniqueName]} ON ROWS FROM [HR]

HTH,

Chris

"Koan B" wrote:

Quote:
Hi,

I need to find a way to identify a particular calculated member, but
the .Name or .UniqueName functions don't appear to be an option;
execute the following query in FoodMart 2000 to see what I mean:

WITH MEMBER [Store].[Name] AS '
[Measures].CurrentMember.Name
'
MEMBER [Store].[UniqueName] AS '
[Measures].CurrentMember.UniqueName
'
SELECT [Measures].AllMembers ON COLUMNS,
{[Store].[Name], [Store].[UniqueName]} ON ROWS
FROM [HR]

You'll see the name and unique name property displayed for the actual
measures in the HR cube, but #ERR for the calculated member [Avg
Salary]. Anyone know of a way I can determine the name of calculated
members as well?

Cheers,
Koan


Reply With Quote
  #3  
Old   
Koan B
 
Posts: n/a

Default RE: MDX function to return the name of a Calculated Member? - 11-10-2004 , 11:26 AM



"=?Utf-8?B?Q2hyaXMgV2ViYg==?="
<OnlyForPostingToNewsgroups (AT) hotmail (DOT) com> wrote in news:54488339-C730-
441B-913D-22ED5FA07935 (AT) microsoft (DOT) com:

Quote:
HTH,

Chris
It most certainly did! Thank you, very much indeed!

Cheers,
Koan


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.