Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to retrieve ancestor?

Status
Not open for further replies.

SilverStray

Programmer
Oct 25, 2001
47
AU
Hi,

I am new to MDX and this is my problem:

I have a dimension and members in the following format:

-Period
-Calendar
+2005
-2006
-Jan 06
-Feb 06
-Mar 06
-Financial
+2005_2006
-Jan 06
-Feb 06
-Mar 06
+2006_2007


I wanted to get the ancestor of Jan 06 in the first level, which should be the 2006, under the Calendar dimension. How can I retrieve the 2006 ancestor under Calendar, when I have Jan 06 as children in both Calendar and Financial dimensions? How can I specify this in my query?

Thanks in advance for your help.

 
I believe it is [Dim].CurrentMember.Parent for auto retrieval or Dim.[Jan 06].Parent

Shoot Me! Shoot Me NOW!!!
- Daffy Duck
 
Ok, my example is wrong. The tree should be like this:

-Period
-Calendar
+2005
-2006
-Jan 06
-Feb 06
-Mar 06
-Financial
+2005_2006
- Qtr 1
-Jan 06
-Feb 06
-Mar 06
+ Qtr 2
+ Qtr 3
+ Qtr 4
+2006_2007

If i am given only the member 'Feb 06', and I want to get the 2006 in the Calendar dimension, how do I do that?

thanks!
 
I would have split Calendar and Financial into 2 different dimensions


'The world isn't round - it's bent!' Spike Milligan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top