Dissecting and debugging MDX queries
When writing a query involving complex calculations, you might have a hard time trying to debug it, in case there is a problem inside the calculation. But there is a way. By breaking complex sets and calculations into smaller pieces and/or by converting those sets and members into strings, we can visually represent the intermediate results and thereby isolate the problematic part of the query.
True, there's no real debugger in the sense that you can pause the calculation process of the query and evaluate the variables. What you can do is to simulate that by concatenating intermediate results into strings for visual verification.
Getting ready
For this recipe we'll use the final query in the previous recipe, Iterating on a set using recursion. We have chosen this as our example because it's a relatively complex calculation and we want to check if we're doing the right thing.
How to do it…
Follow these steps to create a calculated measure that shows the evaluation...