Re: Aggregating Balance items vs P&L items -
07-10-2003
, 01:10 PM
Just a note, if you are in a business environment, the use of
ClosingPeriod is questionable. This function returns the LAST sibling
among the descendants of a member at a specified level. It could work
ONLY if cube loads are done EVERY day, including weekends.
In case of a "business days only" scenario, however, the provided MDX:
([Measures].[Inventory], ClosingPeriod([Time].[Day],
[Time].CurrentMember))'
may not give you the desired inventory snapshot because the last day of
a month (quarter, year) might as well turn out to be a weekend day, so
you'll get an empty value. Also, for the current month, it may
disappoint you too because there would be no value for the last day of
the current month.
Below is the alternative solution (provided you are going MDX as opposed
to the virtual cube solution):
SUM(Tail(Filter(Descendants(Time.Std.CurrentMember , [Time].[Std].[Day]),
NOT IsEmpty([Measures].[Inventory])), 1), [Measures].[Inventory])
It gets the last NON-EMPTY value for a given time member.
Thanks.
YB.
--
Posted via http://dbforums.com |