I'm working on a cube that has two date dimensions, with the same structure, but measuring different behaviours: one measures the stay date, and the other one the reservation date. So I need to create a set that will isolate all reservations made for a specific date, until 1 year prior that specific date. I need the set to be dynamic, so it changes when the stay date changes...
Now, I am blowing my mind off trying to undertand why this works fine:
SET [D365] AS {NULL: [Creation Date].[Calendar].[Day].&[20131023].lag(365)}
But this does not:
SET [D365] AS {null:strtomember("[Creation Date].[Calendar].[Day].&["+ [Business Date].[Calendar].currentmember.properties("Key")+"]").lag(365)}
when
MEMBER [Measures].[Arg] as [Business Date].[Calendar].currentmember.properties("Key")
returns : 20131023
and
MEMBER [Measures].[Arg2] as "[Creation Date].[Calendar].[Day].&["+[Business Date].[Calendar].currentmember.properties("Key")+"].lag(365)"
returns [Creation Date].[Calendar].[Day].&[20131023].lag(365)
I've also tried to use cstr and format ("yyyyMMdd") before the argument, but to no avail...
Really, I am running out of ideas... :)
Thanks a lot for your help.
StrToMember
at all?SET [D365] AS {NULL: [Creation Date].[Calendar].CurrentMember.lag(365)}
should work fine. – FrankPl