This Essbase discussion board is provided as a free service and dedicated to all the Essbase professionals out there!
 Return to Index  

Re: Substring

February 20 2013 at 11:24 AM
No score for this post

Gary Crisci 
from IP address

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

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

WHEN Contains([Date].CurrentMember,
MemberRange([Date].[2012-12-31], [Date].[2012-12-31].FirstSibling))

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.

Good luck

Scoring disabled. You must be logged in to score posts.Respond to this message   

  1. Re: Substring - kiran on Feb 26, 2013, 9:14 AM

RSS feed for this forum - Please email hypess (at), if you have any questions/feedback/issues.