Page 1 of 1

OR in if statement in TI

Posted: Mon Apr 16, 2012 1:24 pm
by jcblough
does this exist, I have the following statement:

['Forecast', '06XW'] =N: IF(('ESP Sales' @= !SSP_m), Continue, 0);

It is zeroing out values for an entire level of a cube sans the measure 'ESP Sales' I want it to leave ESP Sales and another value, is there a proper 'or' structure? "OR", '|', and '||' do not work.

Re: OR in if statement in TI

Posted: Mon Apr 16, 2012 1:43 pm
by lotsaram
Do a search for "tm1 logical operators"

Re: OR in if statement in TI

Posted: Mon Apr 16, 2012 1:44 pm
by Michel Zijlema
jcblough wrote:does this exist, I have the following statement:

['Forecast', '06XW'] =N: IF(('ESP Sales' @= !SSP_m), Continue, 0);

It is zeroing out values for an entire level of a cube sans the measure 'ESP Sales' I want it to leave ESP Sales and another value, is there a proper 'or' structure? "OR", '|', and '||' do not work.
The OR operator is represented by "%".

But in your case you could change the rule to:

['Forecast', '06XW', {'ESP Sales', 'another value'}] =N: 0;

Michel

Re: OR in if statement in TI

Posted: Mon Apr 16, 2012 1:44 pm
by jim wood
Indeed. They can found in the reference guide.

Re: OR in if statement in TI

Posted: Mon Apr 16, 2012 3:25 pm
by jcblough
Thanks, I've seen alot of things, but "%" for OR is a new one.

Re: OR in if statement in TI

Posted: Mon Apr 16, 2012 7:39 pm
by Alan Kirk
jim wood wrote:Indeed. They can found in the reference guide.
And a link to that section of the guide was included under the "Frequently Referenced Sections" heading of the FAQ.

Re: OR in if statement in TI

Posted: Mon Apr 16, 2012 8:10 pm
by jim wood
A link can also be found under the help menu with Architect / Server Explorer. Spoilt for choice really!!! :D

(Not to forget the PDF version in doc library.)