Hi,
Sorry for the simple question as I am new in TM1.
Can we use conditional formulas in defining variables with formula in TI? If yes, what is the syntax, as I could not find it in the documentation.
Can we use other functions in such formulas and where can I find the syntax for those?
Thanks in advance.
Regards,
Conditional Formulas in TI Variables
-
- Community Contributor
- Posts: 139
- Joined: Mon Sep 15, 2008 1:45 pm
Re: Conditional Formulas in TI Variables
Simple question, simple answer.
Yes you can use conditional functions (and a whole range of other functions in TI). Most of the functions you use in rules will also work in TI.
I would recommend you to take a look at the rules / ti functions in the reference guide (which you can access from the help menu). (the conditional function is obviously the IF function btw
)
Yes you can use conditional functions (and a whole range of other functions in TI). Most of the functions you use in rules will also work in TI.
I would recommend you to take a look at the rules / ti functions in the reference guide (which you can access from the help menu). (the conditional function is obviously the IF function btw

- mce
- Community Contributor
- Posts: 352
- Joined: Tue Jul 20, 2010 5:01 pm
- OLAP Product: Cognos TM1
- Version: Planning Analytics Local 2.0.x
- Excel Version: 2013 2016
- Location: Istanbul, Turkey
Re: Conditional Formulas in TI Variables
I now realized that there is a different syntax for the functions (IF) in TI than the ones in Rules.
Thanks.
Thanks.
- rkaif
- Community Contributor
- Posts: 328
- Joined: Fri Sep 05, 2008 6:58 pm
- OLAP Product: IBM Cognos TM1
- Version: 9.1 or later
- Excel Version: 2003 or later
Re: Conditional Formulas in TI Variables
Within the Rules use the following syntax:
For TI Process use the following syntax:
You can also use multiple IF at a time and the syntax will be:
Code: Select all
IF(expression, true_value, false_value)
Code: Select all
If(expression);
statement1;
Endif;
Code: Select all
If(expression);
statement1;
ElseIf(expression);
statement2;
ElseIf(expression);
statement3;
EndIf;
Cheers!
Rizwan Kaif
Rizwan Kaif
- Martin Ryan
- Site Admin
- Posts: 2003
- Joined: Sat May 10, 2008 9:08 am
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 2010
- Location: Wellington, New Zealand
- Contact:
Re: Conditional Formulas in TI Variables
It's possible to use the Rule sytax in TI too. E.g.
# This will assign the value 'One' or 'Two' to the variable v1, depending on the outcome of the condition
v1=if(v2<>v3, 'One', 'Two');
or
# This will either skip the current line, or continue processing it, depending on the outcome of the condition.
if(v2<>v3, ItemSkip, 0);
Obviously the TI version of "if" provides more flexibility (and arguably readability), but the rule way can mean less lines of code.
Martin
# This will assign the value 'One' or 'Two' to the variable v1, depending on the outcome of the condition
v1=if(v2<>v3, 'One', 'Two');
or
# This will either skip the current line, or continue processing it, depending on the outcome of the condition.
if(v2<>v3, ItemSkip, 0);
Obviously the TI version of "if" provides more flexibility (and arguably readability), but the rule way can mean less lines of code.
Martin
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
Jodi Ryan Family Lawyer