I see that Richard Tkachuk has put up two more MDX Scripting white papers on his site in addition to the ‘Loading Aggregate Data’ paper that Mosha pointed to in his blog at the end of last year. All three go into a lot of detail and show off some of the cool new features available in AS2005 MDX such as the ability to return a set from an IIF statement.
Looking at the gigantic statement used to retrieve a comment for a cell in the middle of the ‘Cell Annotations’ paper reminded me of a feature I’ve thought would be useful on several occasions: the ability to create sets containing dimensions instead of members. In Richard’s MDX he’s forced to hard-code the names of all the dimensions in his cube in order to get the keys of the currentmember of each of them; if you could simply get a set of all dimensions in the cube, you could then iterate over that set with a GENERATE statement and get the keys using something like a CURRENTDIMENSION function. This would also make the code somewhat more robust, as it would no longer break if you added or removed dimensions from the cube. I don’t know whether this kind of functionality is feasible or not, but I thought I’d mention it…
Yes, perhaps it was a little bit premature to put the Cell Annotations whitepaper out, because we do have a next version which doesn\’t have this gigantic assignment, but uses Generate. Now it is MDX puzzle to you how to make it work 🙂 Anyway, this is the reason why I didn\’t want to blog about it yet, waited for better version of our whitepaper to come out.