MDX Parameter with Multiple Members Consolidated into Single Value

Who is online?  0 guests and 1 members
Home  »  Blogs  »  DustinRyan  »  MDX Parameter with Multiple Members Consolidated into Single Value
 
4.69
/5
Avg: 4.69/5: (1 votes)

Comments (4)

DevinKnight
DevinKnight said:
Cool post Dustin! That darn MDX comes up everwhere.
2/6/2010
 · 
 
by
mikedavis
mikedavis said:
Good post, I like it.
2/7/2010
 · 
 
by
MarkGStacey
MarkGStacey said:
What, MDX isn't your favorite language? Hmmmk :-) What you can do, especially if you have the underlying tables, is something like this: SELECT 'A' Name, '( { [Test].[Class].&[1]&[A], [Test].[Class].&[2]&[A] } )"' Value UNION ALL SELECT 'B', '( { [Test].[Class].&[1]&[B], [Test].[Class].&[2]&[B] } )"' Value UNION ALL SELECT 'A+B', '( { [Test].[Class].&[1]&[A], [Test].[Class].&[2]&[A], [Test].[Class].&[1]&[B], [Test].[Class].&[2]&[B] } )' UNION ALL SELECT Class1.Name , '( { [Test].[Class].&[1]&[' + Class1.Name + '], [Test].[Class].&[2]&[' + Class1.Name + '] } )"' Value FROM classTable Class1 INNER JOIN classTable Class2 ON Class1.Name = Class2.Name AND Class2.ClassType = 2 WHERE Class1.ClassType = 1 And here you generate the set to look like the MDX set, but with more control over how it's built up. In addition, you could do the same, but replace the final select with a query against the cube using an OPENROWSET I VERY often do something similar with the openrowset for balancing my cubes - getting the cube data into a form where I can compare it easily to the table data
4/18/2010
 · 
 
by
dustinryan
dustinryan said:
Cool, Mark. That's a good tip. Thanks.
4/20/2010
 · 
 
by
Blogs RSS Feed

DustinRyan's latest blog posts

Blogs RSS Feed

Latest community blog posts