Page 1 of 1

Attribute Cube Rules

Posted: Fri May 16, 2008 8:13 pm
by Eric
Once again I think I am asking a easy question for you guys, but the syntax is messing with me.

I have the following Rule
['FAMILY'] = S:ELPAR('Codes',!Codes,1);

However, I only want it to calculate for the leaf level. So I tried
['FAMILY'] = S:N:ELPAR('Codes',!Codes,1);

It did not work. Am I doing something wrong? I am guessing I can combind IF & ELPARN but I was hoping for something easier to read (C: & N:).

Kind of like
IF( ELPARN(ELPAR('Codes',!Codes))=0, S:ELPAR('Codes',!Codes,1);
ElseIf (ELPARN(ELPAR('Codes',!Codes))>0,'somthing');

Any thoughts?

Re: Attribute Cube Rules

Posted: Fri May 16, 2008 8:21 pm
by Mike Cowie
Eric,

As you've seen (S:)tring and (N:)umeric don't mix in the same rule. Have you looked at the ISLEAF function?

Code: Select all

['FAMILY'] = S: IF(ISLEAF() = 1, ELPAR('Codes',!Codes,1), STET);
At the lowest level this rule will calc the ELPAR and above that you'll be able to in put values (STET = let it stand/no rule calc). I think ISLEAF has been around for a little while now and I use it most often writing drill-through rules.

Regards,

Re: Attribute Cube Rules

Posted: Fri May 16, 2008 8:36 pm
by Eric
Yep I just found that I ended up doing

FEEDSTRINGS;
SKIPCHECK;

['FAMILY'] = S: IF( (ISLEAF = 1)
, ELPAR('Codes',!Codes,1)
, !Codes
);

FEEDERS;
[]=>['FAMILY'];


Thanks!