Behaviour of Descendants with SELF option in AS2005 -
09-05-2006
, 05:06 AM
Hi,
I've looked around on the web but couldn't find anything related to
this.
My workplace has a product that uses MDX to talk to AS 2000. We've made
changes so that it can talk to AS2005 as well, but there's one function
that behaves differently in the two different versions, and I can't
tell if it is an undocumented change or a bug. The DESCENDANTS
function, when passed the arguments "<member of hierarchy>, 1", returns
nothing in 2000 if the member is a leaf node and there isn't a level
below, but in 2005 returns the leaf node's level. This happens if the
number is anything from 1 upwards. (The behaviour seems to be, if there
isn't a level at the given distance, then use the last valid one.)
As there isn't a flag specified, it should be defaulting to SELF (which
I believe it is). The description of SELF in the help is a bit vague
but suggests that the member specified will only be included in the
results if it is a member of the level given in the second parameter.
(The help unfortunately doesn't discuss how it behaves if you give
distance rather than a specific level.)
An example, using FoodMart 2000, is:
WITH
Set finalColSet1 as
'Hierarchize({ADDCALCULATEDMEMBERS({[Time].[1997],DESCENDANTS([Time].[1997],1)})})'
Set finalRowSet1 as 'DESCENDANTS([Store].[All
Stores].[USA].[WA].[Bremerton].[Store 3],1)'
SELECT NON EMPTY {finalColSet1} PROPERTIES PARENT_COUNT,
CHILDREN_CARDINALITY, PARENT_UNIQUE_NAME ON COLUMNS,
NON EMPTY {finalRowSet1} PROPERTIES PARENT_COUNT, CHILDREN_CARDINALITY,
PARENT_UNIQUE_NAME ON ROWS
FROM [Budget] WHERE ([Account].[All Account],[Category].[All
Category],[Measures].[Amount])
The important part of this is the finalRowSet1, which should consist of
members one level below from the given node, which is a leaf node, so
in theory nothing should be returned. In 2000 this complains that there
is nothing to return, but in 2005 it returns a row for Store 3. The
above might seem like an odd thing to do, but it is a simplified
example, and is built up based on various settings in the application.
Is anyone aware of any changes in this area for AS2005? I haven't seen
anything on the Microsoft website or elsewhere that describes this
change, or lists it as a problem.
Thanks.
--
Neil Brown |