Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MDX works different for aggregate function last child vs sum measures

9 views
Skip to first unread message

Greg

unread,
Jul 23, 2007, 12:09:12 PM7/23/07
to greg.h...@cpwm.com
The first MDX calculation below works fine with a measure that is
defined with a LAST CHILD or SUM aggregate function. The second
calculation does NOT work with a LAST CHILD aggregate function but
does work when the measure has a SUM aggregate function. Why? Any
suggestions how to make it work for a measure with a LAST CHILD
aggregate function? Thank you.

#1

Scope({[Calendar].[Fiscal Year].&[2003],
[Calendar].[Fiscal Year].&[2011]},
[Calendar].[Calendar sk].members,
[Store Comp].[Store Comp].[All Stores]);

([Date Calculations].[Amount LY]=
(ParallelPeriod([Calendar].[Fiscal Calendar].[Fiscal Year],1,
[Calendar].[Fiscal Calendar].CurrentMember),
[Date Calculations].&[Amount]));

**********************************************************************
#2

Scope({ DESCENDANTS( [Calendar].[Fiscal Calendar].[Fiscal
Year].&[2006],
[Calendar].[Fiscal Calendar].[Date])},
[Store Comp].[Store Comp].[All Stores]);

([Date Calculations].[Amount LY]=
(ParallelPeriod([CalendarShift].[Fiscal Calendar].[Fiscal Year],1,
LinkMember([Calendar].[Fiscal Calendar].CurrentMember,
[CalendarShift].[Fiscal Calendar])).lead(7)
,[Date Calculations].&[Amount]
,[Calendar].[Fiscal Calendar].[All Fiscal Years]));

0 new messages