writing a rule for 70+ elements that all start with XX...

Post Reply
kbogies
Posts: 31
Joined: Tue Jun 10, 2008 8:21 pm
OLAP Product: TM1
Version: 9.1sp4 64x
Excel Version: 2003
Location: Hartford, CT

writing a rule for 70+ elements that all start with XX...

Post by kbogies »

Hi all,
I'm trying to write some ratio rules in the Server Explorer and there's a pretty big IF; if elements [start with X....] then... Is there a rule that i can write for "starts with"? I'd really prefer not to write 72 individual rules for all the multi-level decendants (which all start with X).

Thanks!
User avatar
Martin Ryan
Site Admin
Posts: 1988
Joined: Sat May 10, 2008 9:08 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2010
Location: Wellington, New Zealand
Contact:

Re: writing a rule for 70+ elements that all start with XX...

Post by Martin Ryan »

Try "subst"

E.g. if(subst(!Elem, 1, 2)@='xx', true, false).

Martin
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
lotsaram
MVP
Posts: 3667
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: writing a rule for 70+ elements that all start with XX...

Post by lotsaram »

2c

Functions like SUBST and SCAN can be very expensive in terms of calculation efficiency. I would approach this by setting an attribute for the elements based on the starting string and basing the rule off a simple attribute lookup rather than a string function.
kbogies
Posts: 31
Joined: Tue Jun 10, 2008 8:21 pm
OLAP Product: TM1
Version: 9.1sp4 64x
Excel Version: 2003
Location: Hartford, CT

Re: writing a rule for 70+ elements that all start with XX...

Post by kbogies »

just to follow up... i used an attribute on all 70+ elements to use for a lookup in a reference cube. seems to work pretty smoothly.

Thanks!
User avatar
wissew
Posts: 54
Joined: Tue Jun 17, 2008 7:24 pm
OLAP Product: TM1
Version: 9.5.2; 10.2.2; 11
Excel Version: 2003 SP3 - 2013
Location: Beaverton, OR

Re: writing a rule for 70+ elements that all start with XX...

Post by wissew »

kbogies wrote:just to follow up... i used an attribute on all 70+ elements to use for a lookup in a reference cube. seems to work pretty smoothly.

Thanks!

Correct, attributes are the way to go!
Post Reply