Hi all,
I have 2 Dimensions D1 and D2. They both have a common Attribute "ID".
For one id in D1 there are multiple records in D2. This is like a parent child relationship with Product as parent Dimension and Product category as child dimension. For each product there are multiple product categories.
I want to get the Min and Max from child Dimension for each ID in Parent Dimension.
In sql this can be written as
select Distinct D1.ID,Min(D2.AttributeName) from D1,D2 where
D1.ID=D2.ID group by D2.ID
Can anybody write a MDX based on this?
Thanks
Girija.
Girija,
When there is Parent-Child Relationship between D1 and D2 as described Product and Product Category, I feel there should be Hierarchy in Cube for D1 and D2. And hoping you have set Order By Property to Key which stores ID and then simply you could use FirstChild for Min and LastChild for Max ID.
Bhudev
|||Hi bhudev,
I gave parent - child reationship just as an example..... There is no hierarchy between those two dimensions.... They are connected only through ID.
Regards...
Girija Shankar
|||Girija
I'm giving you the way how you can do it. Simply make Calculated Members for these ID under Measures Dimension and apply Min and Max function, I hope you will get yourself.
Bhudev
No comments:
Post a Comment