posted 2/5/2010 by DustinRyan - Views: [3655]
Today I was working on a report built on a cube and stumbled on to an interesting requirement by some of our client's end users (EU). EU wanted to be able to consolidate multiple, specific members into a single parameter value. For example, if EU selected the parameter item A, they should see all members in the report where the value is actually 1 A and 2 A. So by selecting a single parameter value, EU will have actually selected 2 parameter values and will see the associate members in the report.
With a little brain storming, I came up with an easy way to accomplish this without having to mess around with the MDX, due to the fact that my MDX skills are quite lacking.
Note: This solution is only feasible if you only have a couple of possible values in your parameter. If you need to have more than a couple options in your parameter, you'll probably want to figure something else out.
So open the properites of the parameter you are working on. Instead of using a query to determine available values, you'll need to specify the available values in the report. This is the reason why if you have data that is constantly changing in the cube related to this report or you have more than a few values, you're going to have to figure something else out.
Here you can see how I specified my values for the parameter:
For Parameter A, I used this expression to select both members associated with A:
"( { [Test].[Class].&[1]&[A], [Test].[Class].&[2]&[A] } )"
And for B:
"( { [Test].[Class].&[1]&[B], [Test].[Class].&[2]&[B] } )"
Since this parameter cannot be a multivalue parameter, I specified a parameter value of "All" so the user can still see both A and B at the same time. Here is that expression:"( { [Test].[Class].&[1]&[A], [Test].[Class].&[2]&[A], [Test].[Class].&[1]&[B], [Test].[Class].&[2]&[B] } )"
In this way, I'm able to actually select multiple members with a single parameter value. I hope someone finds this helpful.