Business Rules Help

Post Reply
ALAHARI
Posts: 4
Joined: Fri Feb 05, 2016 5:14 pm
OLAP Product: cognos Transformer,TM1
Version: 10.1
Excel Version: 1

Business Rules Help

Post by ALAHARI »

Hi

I AM TRYING TO WRITE A RULE MIMICKING AN EXCEL BY COMPARING 2 VALUES IN A CUBE . NOT SURE IF I AM DOING CORRECTLY.

IN EXCEL THE LOGIC IS IF HIGHESTREMOVAL IS 0 THEN NEW ALLOCATION

['FINALALLOCATION' ] = N:IF(['HIGHESTREMOVAL' ] @= 0, ['NEWALLOCATION' ] ,STET);

APPRECIATE YOUR HELP.
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: Business Rules Help

Post by tomok »

ALAHARI wrote:Hi

I AM TRYING TO WRITE A RULE MIMICKING AN EXCEL BY COMPARING 2 VALUES IN A CUBE . NOT SURE IF I AM DOING CORRECTLY.

IN EXCEL THE LOGIC IS IF HIGHESTREMOVAL IS 0 THEN NEW ALLOCATION

['FINALALLOCATION' ] = N:IF(['HIGHESTREMOVAL' ] @= 0, ['NEWALLOCATION' ] ,STET);

APPRECIATE YOUR HELP.
"@=" is for string comparisons. For numeric just use "=".
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
ALAHARI
Posts: 4
Joined: Fri Feb 05, 2016 5:14 pm
OLAP Product: cognos Transformer,TM1
Version: 10.1
Excel Version: 1

Re: Business Rules Help

Post by ALAHARI »

Thanks!!!!Tom

I am trying to replicate the below string case statement . can you please correct me

excel-=IF(AND(LANDINGS="NO",'CURRENTONHAND'>0),"Excess Stock",
IF(AND(LANDINGS="NO",CURRENTONHAND>0),"Excess Allocation",

['REVIEWCODE' ] = N:IF (!LANDINGS @= 'NO' & ['CURRENTONHAND' ] > 0, 'EXCESS STOCK',CONTINUE);
['REVIEWCODE' ] = N:IF (!LANDINGS @= 'NO' & ['CURRENTALLOCATION' ] > 0, 'EXCESS STOCK');
Wim Gielis
MVP
Posts: 3240
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Business Rules Help

Post by Wim Gielis »

Perhaps:

Code: Select all

['REVIEWCODE' ] = S:IF (!LANDINGS @= 'NO' & ['CURRENTONHAND' ] > 0, 'EXCESS STOCK',CONTINUE);
['REVIEWCODE' ] = S: IF (!LANDINGS @= 'NO' & ['CURRENTALLOCATION' ] > 0, 'EXCESS STOCK', '');
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
declanr
MVP
Posts: 1831
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: Business Rules Help

Post by declanr »

Just to add to Wim's reply you need to use =S: notation to populate a string (text) measure; for this to work you need to make sure that ReviewCode exists in the dimension that is last in order in the cube and is given a string type.

You can also make the code slightly shorter; the !landings notation can go on the left hand side of your rule and you can remove the need for 2 separate statememts:

Code: Select all

['NO','ReviewCode']=S:
If ( ['CurrentOnHand'] > 0 % ['CurrentAllocation'] > 0, 'Excess Stock','');
Declan Rodger
ALAHARI
Posts: 4
Joined: Fri Feb 05, 2016 5:14 pm
OLAP Product: cognos Transformer,TM1
Version: 10.1
Excel Version: 1

Re: Business Rules Help

Post by ALAHARI »

Thanks you guys!!!
Post Reply