troubleshooting Question

How to show primary key of Parent-Child hierarchy

Avatar of Luigi2009
Luigi2009Flag for Czechia asked on
Microsoft SQL ServerMicrosoft SQL Server 2005Microsoft SQL Server 2008
2 Comments1 Solution741 ViewsLast Modified:
I have dimesion with ragged Parent-Child hierarchy. For instance organizational structure of a company. Commonly the hierarchy shows names of hierarchy items but now I need to create MDX query where result on axis 1 will be ID (primary key of dimesion) of item and name of item, but main is to show id.

SELECT {} ON 0,
{[Product].[MetaGroupHierarchy].children} ON 1
FROM MyOLAPCube

With mentioned MDX query the result is :

name1
name2
name3
...

And I would like to have:
ID1, name1
ID2, name2
ID3, name3

or

ID1
ID2
ID3


I do not know how to construct MDX query in this case.  Because main dimesion key has to have NameColumn property set to filed with name of item.

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros