dbTalk Databases Forums  

Can we get Member Key & Name in the same MDX Query?

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


Discuss Can we get Member Key & Name in the same MDX Query? in the microsoft.public.sqlserver.olap forum.



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

Default Can we get Member Key & Name in the same MDX Query? - 04-28-2005 , 08:52 AM






Hi,

I want to get both the Member Name & the Member key for each dimension
in the MDX Query.

This way, i can use the Member name for display purposes. And use Member Key
as a parameter (query string) in the link to drill down.

Is there a way to do this?

Thanks,

Sam

Reply With Quote
  #2  
Old   
Dave Wickert [MSFT]
 
Posts: n/a

Default Re: Can we get Member Key & Name in the same MDX Query? - 04-28-2005 , 07:01 PM






Sure. In MDX syntax, you reference a key using the & character.
From Foodmart:

select
{[Measures].[Avg Salary]} on columns,
{[Employees].[All Employees].[Sheri Nowmer].Children} on rows
from HR
and

select
{[Measures].[Avg Salary]} on columns,
{[Employees].[All Employees].&[1].Children} on rows
from HR

Return the same values since Sheri's member key is 1.

Hope that helps.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Prasad" <Prasad (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi,

I want to get both the Member Name & the Member key for each dimension
in the MDX Query.

This way, i can use the Member name for display purposes. And use Member
Key
as a parameter (query string) in the link to drill down.

Is there a way to do this?

Thanks,

Sam



Reply With Quote
  #3  
Old   
Prasad
 
Posts: n/a

Default Re: Can we get Member Key & Name in the same MDX Query? - 04-29-2005 , 09:52 AM



Hi Dave,

My question is liitle bit different.

I want to see both the Key and the name in the same MDX Statement.

Example:

Name - ID - Billed Amount
---------- ---- ----------------
North East - 'NE' - 12000
SouthWest- 'SW' - 28000
MidAtlantic- 'MA' - 45000

In my Geography Dimension ' North East' is the Member Name (Description) &
NE is the Member Key.

Why i want like this is, i want to use 'North East' for display purpose &
'NE' to pass it as a link to the URL fo rdrill down.

Hopefully this time i am clear of what i want.

Best Regards,

Sam.


"Dave Wickert [MSFT]" wrote:

Quote:
Sure. In MDX syntax, you reference a key using the & character.
From Foodmart:

select
{[Measures].[Avg Salary]} on columns,
{[Employees].[All Employees].[Sheri Nowmer].Children} on rows
from HR
and

select
{[Measures].[Avg Salary]} on columns,
{[Employees].[All Employees].&[1].Children} on rows
from HR

Return the same values since Sheri's member key is 1.

Hope that helps.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Prasad" <Prasad (AT) discussions (DOT) microsoft.com> wrote in message
news:399C6103-DAF2-4F8E-BB89-4CF367F80475 (AT) microsoft (DOT) com...
Hi,

I want to get both the Member Name & the Member key for each dimension
in the MDX Query.

This way, i can use the Member name for display purposes. And use Member
Key
as a parameter (query string) in the link to drill down.

Is there a way to do this?

Thanks,

Sam




Reply With Quote
  #4  
Old   
Dave Wickert [MSFT]
 
Posts: n/a

Default Re: Can we get Member Key & Name in the same MDX Query? - 04-29-2005 , 09:00 PM



The key is available as a property of a member in MDX.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Prasad" <Prasad (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi Dave,

My question is liitle bit different.

I want to see both the Key and the name in the same MDX Statement.

Example:

Name - ID - Billed Amount
---------- ---- ----------------
North East - 'NE' - 12000
SouthWest- 'SW' - 28000
MidAtlantic- 'MA' - 45000

In my Geography Dimension ' North East' is the Member Name (Description) &
NE is the Member Key.

Why i want like this is, i want to use 'North East' for display purpose &
'NE' to pass it as a link to the URL fo rdrill down.

Hopefully this time i am clear of what i want.

Best Regards,

Sam.


"Dave Wickert [MSFT]" wrote:

Sure. In MDX syntax, you reference a key using the & character.
From Foodmart:

select
{[Measures].[Avg Salary]} on columns,
{[Employees].[All Employees].[Sheri Nowmer].Children} on rows
from HR
and

select
{[Measures].[Avg Salary]} on columns,
{[Employees].[All Employees].&[1].Children} on rows
from HR

Return the same values since Sheri's member key is 1.

Hope that helps.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no
rights.

"Prasad" <Prasad (AT) discussions (DOT) microsoft.com> wrote in message
news:399C6103-DAF2-4F8E-BB89-4CF367F80475 (AT) microsoft (DOT) com...
Hi,

I want to get both the Member Name & the Member key for each dimension
in the MDX Query.

This way, i can use the Member name for display purposes. And use
Member
Key
as a parameter (query string) in the link to drill down.

Is there a way to do this?

Thanks,

Sam






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.