# Operators in TM1 Rule IF Statements

Do you need to create an IF expression in a TM1 rule with a logical operator? To create something that is like and AND or OR from SQL but do it in a Rule? Look no further!

If, however, you are looking for IF operators for a Turbo Integrator process, please check this post.

## TM1 Rule Operators

There are some very useful operators available in TM1 Rules. Use

• For OR, use a percent sign: %
• For AND, use and ampersand: &

## Example

Here is an example of creating a rule that uses the & operator to check if multiple elements are zero and if so, return a 0 and otherwise return a 1.

`['Below Meet or Exceed'] = C:`

`                IF ( ( ['Exceeds Standard'] = 0 &  ['Meets Standard or No Activity'] = 0 & ['Below Standard'] = 0)`

`                                , 0`

`                                , 1`

`                );`

This says that if the elements Exceeds Standard, Meets Standard or No Activity or Below Standard are all equal to zero, then set the consolidation of Below Meet or Exceed to 0 and if any of them is not equal to zero, then return 1.