Page 1 of 1
Stet and Continue in Rules
Posted: Fri Sep 09, 2011 1:31 am
by winsonlee
Hi everyone,
[] = IF (!p_Version @<> 'Current Version' & !p_Version @<> 'Budget' , Stet, continue);
I would like to confirm if I have interpreted the rules correctly.
Does the above rules means that if version = "Current Version" and "Budget", please apply all the rules listed. Else ignore all the rules ?
Re: Stet and Continue in Rules
Posted: Fri Sep 09, 2011 2:30 am
by Mike Cowie
Sort of. The version can't be both "Budget"
AND "Current Version" at the same time for a given cell in the cube, but I think what you're hoping is for cells in the cube to be left alone (no rules) if the version is anything other than "Current Version" or "Budget". If it's "Current Version" or "Budget", then you would like later rules to apply for this cube. The rule statement below seems to cover that. You could have written it this way, too:
Code: Select all
[] = IF (!p_Version @= 'Current Version' % !p_Version @= 'Budget' , CONTINUE, STET);
Which seems a bit clearer to me, but that's probably my own personal bias/preference. Also, if you expect to add more versions over time and don't want to edit the rules if additional versions need to be treated like "Current Version" or "Budget" you could consider adding an attribute to your "p_Version" dimension that helps identify which versions should have rules or not. For example:
Code: Select all
[] = IF (ATTRN( 'p_Version', !p_Version, 'Is Calc' ) = 1, CONTINUE, STET);
Regards,
Mike
Re: Stet and Continue in Rules
Posted: Fri Sep 09, 2011 3:17 am
by winsonlee
Yeap, you are right. the rules you mention is much clearer and easier to understand. The previous rules was put in by a consultant and it took me a while to get my head around.
[] = IF (!p_Version @= 'Current Version' % !p_Version @= 'Budget' , CONTINUE, STET);
Re: Stet and Continue in Rules
Posted: Fri Sep 09, 2011 5:34 am
by Michel Zijlema
As 'Current Version' and 'Budget' appear to be the actual element names in the p_Version dimension, you alternatively could write the rule as:
[{'Current Version','Budget'}] = STET;
...other rules follow here...
I personally try to avoid the IF checks in rules where possible, as these, to my knowledge, can have a negative impact on performance (I have never tested the significance - cue Mike, Lotsa

)
Michel
Re: Stet and Continue in Rules
Posted: Fri Sep 09, 2011 6:05 am
by Steve Rowe
Otherway around I think Michel,
{'Current Version','Budget'}] = Continue;
[]=Stet;
Which I don't think would work as the stet rule would be the other part of the continue statement.
Sounds to me like the dev wrote all the rules for the cube and then the users said "but we only want the rules to appply to Current Version and Budget" and the rule shown was the easiest answer. They could have gone through and qualified the LHS of all the rules but that would be pain to look after if all the versions the rules apply to change.
The feeders for the rules will still need to be qualified on the LHS as there's not "stet" like function for feeders (would that be useful I wonder?)
Incidently I see not= written in this form alot
[] = IF (!p_Version @<> 'Current Version' & !p_Version @<> 'Budget' , Stet, continue);
I usually write this as follows
[] = IF (~(!p_Version @= 'Current Version' % !p_Version @= 'Budget') , Stet, continue);
IMO easier to read but I guess it is easy to miss the tilda..
Cheers Steve
Re: Stet and Continue in Rules
Posted: Fri Sep 09, 2011 8:15 am
by Michel Zijlema
Steve Rowe wrote:Otherway around I think Michel
Oops - I should not post between breakfast and catching a train (or at least read more carefully)...
Michel