Hello,
I am trying to retrieve the last 3 periods from the current month (ie Sept, Oct, Nov). I am thinking that LastPeriods function might work, but I am getting the following Error "The LASTPERIODS function expects a member expression for the 0 argument. A tuple set expression was used." Here's the code.
SELECT { LASTPERIODS (3, TAIL(nonempty([Week].[Week].[Week Name].Members)) ) } ON COLUMNS FROM [GMDSummary]
Maybe something like that ?
SELECT { LASTPERIODS (3, TAIL(nonempty([Week].[Week].[Week Name].Members)).Item(0).Item(0) ) } ON COLUMNS FROM [GMDSummary]
|||Hello,
I ran into another issue as to I would like to order the [Week Name] by the Member Key. Currently, the LastPeriods() is returning "Week of 12/25/2006", "Week of 12/17/2006" instead of "Week of 1/22/2007" because it is order by Member Name instead I would like to order by Member Key. Can anyone help me with the code below so the LastPeriods() is indeed the last 3 week (order by Member Key) instead of by Member Name?
SELECT { LASTPERIODS (3, TAIL(nonempty([Week].[Week].[Week Name].Members)).Item(0).Item(0) ) } ON COLUMNS FROM [GMDSummary]
Much Appreciated!
-Lawrence
|||y cant we use LAG function. It is more easier right?
No comments:
Post a Comment