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 205.228.53.11


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

CASE
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

CASE
WHEN Contains([Date].CurrentMember,
MemberRange([Date].[2012-12-31], [Date].[2012-12-31].FirstSibling))
THEN 1
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.

Good luck




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

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

RSS feed for this forum - http://www.network54.com/Forum/58296?xml=rss. Please email hypess (at) gmail.com, if you have any questions/feedback/issues.