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.
Business Rules Help
-
- 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
"@=" is for string comparisons. For numeric just use "=".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.
-
- 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
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');
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');
-
- 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
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
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
-
- 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
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:
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
-
- 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
Thanks you guys!!!