I'm trying to write an MDX query that returns a result that includes a list of members, their Id's, and a measure value. In this example, I have a fact table that is rating values from a survey. Each rating value has a foreign key to the Question dimension which has Id and Name columns. The information I want is each quesion's Id and Name with the aggregate average rating. So far I can get Id and Rating, or Name and Rating, but I am not sure how to get both.
Here is the query I have tried:
SELECT
NON EMPTY {[Measures].[Rating]} ON COLUMNS,
NON EMPTY {[Question].[Question Id].Members,
[Question].[Question Caption].Members} ON ROWS
FROM [Ratings]
And it almost works except I get duplicate values, here is a sample result:
[Question].[10] 3.5
[Question].[11] 4.2
[Question].[12] 4.9
[Question].[13] 4.0
[Question].[10].[blar abc] 3.5
[Question].[11].[blar def] 4.2
[Question].[12].[blarrr] 4.9
[Question].[13].[something else] 4.2
You can see that Question 10 shows up twice with a 3.5 rating, once without the name and once with it.
Is what I want to do possible with MDX? What am I missing? This is being executed by Mondrian.