Null and the colon operator

I spotted another minor, but interesting new bit of functionality in AS2005 MDX while reading the new article on time intelligence that Mosha links to here – when using the colon operator to get a range of members, you can now use null on one side to denote either the first member or last member on the same level as the member explicity mentioned. So, for instance:

select [Measures].[Internet Sales Amount] on 0,
null : [Date].[Day of Week].[Day of Week].&[3]
on 1
from
[Adventure Works]

returns the members from Day 1 up to and including Day 3 on the Day of Week attribute; similarly:

select [Measures].[Internet Sales Amount] on 0,
[Date].[Day of Week].[Day of Week].&[3] : null
on 1
from
[Adventure Works]

returns the members from Day 3 up to and including Day 7. This will definitely make many calcs a lot more readable.

 

2 thoughts on “Null and the colon operator

  1. Wow, I didn\’t even realize it was new functionality. I implemented it like that because I thought AS2K worked that way. But now I rechecked – in AS2K it was possible to use NULL members on either side of the range, but only if they were obtained through some MDX functions, but not for explicit NULL.

Leave a Reply