Re: SubstringFebruary 20 2013 at 11:24 AM
No score for this post
from IP address 18.104.22.168
Response to Re: Substring
There are a number of ways to do this given the simple layout of your time dim, if it were me, I would just set a member range since you know the starting and ending members of the range.
Datepart is not going to work because you do not have dates, you have strings that just happen to look like dates.
To answer your specific question you would use the following
WHEN SUBSTRING([Date].CurrentMember.MEMBER_NAME, 1,4) = ("2011") THEN 1
WHEN SUBSTRING([Date].CurrentMember.MEMBER_NAME, 1,4) = ("2012") THEN 1
ELSE 0 END'
Note that CurrentMember returns a member, the substring function is expecting a string, so you need to add the property MEMBER_NAME to get the member as a string.
To use a member range you could do something like
ELSE 0 END
You could then set the [2012-12-31] as a subvar on the server and update it when the year changes without having to touch the outline.
Couple of other ways to do this but either of these should be sufficient.
- Re: Substring - kiran on Feb 26, 2013, 9:14 AM