If you have a set of members defined in the following way:
how can you write an MDX query that reverses the order of this set?
SELECT \[Reverse\] ON COLUMNS
This answer demonstrates a couple of good MDX tricks. It shows how to use the keyword item to index into a set and how to use the Rank function to find a member's position in a set.
The Generate function evaluates its second parameter for each item in the set \[97Quarters\]. For example, the first evaluation of the second parameter is with \[1997\].\[Q1\]. Count(\[97Quarters\]) is always 4. The Rank( \[1997\].\[Q1\], \[97Quarters\] ) is 1 because Q1 is the first member of the \[97Quarters\] set. So the Generate function evaluates \[97Quarters\].item( 4 1 ) and returns the 4th item (Q4) in the set because the item property uses a zero-based index.