Page 1 of 1

Cell check in a rule

Posted: Thu Jul 29, 2010 8:09 pm
by Toto
Hello,

I would like to make a colum rule like = 'If the value in a cell is under 30, change the value to 30'.
Tried something like: ['columnA'] = if([columnA]<30,[columnA]=30,continue);

Apparently this is a recursive call and the the rule never ends...

But how can I do this kind of calculation?

Thanks a lot,

Toto

Re: Cell check in a rule

Posted: Thu Jul 29, 2010 8:46 pm
by omcleod
You could use the DB function to check the value in a cell within the same cube:

example:
['columnA'] = N: if(DB(cubename, e1, e2)<30,30,continue);

Re: Cell check in a rule

Posted: Fri Jul 30, 2010 7:08 am
by Toto
Got it, thanks a lot!

Toto

Re: Cell check in a rule

Posted: Mon Aug 02, 2010 5:37 pm
by Steve Rowe
I'm pretty sure this will still create a circular reference

['columnA'] = N: if(DB(cubename, e1, e2)<30,30,continue);

If cubename is the same cube you are writing the rules in

Since at run time either !e1 or !e2 will resolve to 'coulmnA'

The way you have written your rule there's no way to do this (with rules) in TM1.

Is more correct

['columnA','measure2'] =N: if(['measure1']<30,30,continue);

The only way to get the results in the same cell as you are testing would be to process the dataset through TI, but then it would not be live.

HTH