Parentheses

Definition

Parentheses in this case refer to the round brackets ( and ). They are used in formulas with functions, math and logic. Parentheses are very powerful tools in InfoView because they direct when and how groups of things should be processed.

General note: All open parentheses, e.g. (, must be closed inside the formula, otherwise InfoView will not be able to process your variable. Parentheses can also be nested within each other, e.g. (()).

Video

Parentheses

Functions

Functions use parentheses to delineate exactly what should be processed and what should not. In the parentheses that follow a function, everything between them will be processed by the function. The open parenthesis tells the function to start acting and the closing parenthesis tells the function to stop. See the Aggregate Functions Guide for examples.

Math

InfoView completes mathematical transactions according to "Operator Precedence", which is another word for "Order of Operations" from high school algebra. The Operator Precedence dictates that certain mathematical calculations happen before others. For example, multiplication and division happen before addition and subtraction. However, parentheses contents always calculate first.

The formula =2+3*4 will compute as follows: 3 times 4 is 12, then add two to make 14

The formula =(2+3)*4 compute as follows: 2 plus 3 is 5, then multiplied by 4 will make 20.

Both formulas are completely legitimate in InfoView, either computed with typed-numbers or replaced by objects, but the two formulas will produce different numeric results.

Logic

Logic is completed with ANDs, ORs and NOTs. If you're unfamiliar with ANDs, ORs or NOTs, please look at the Boolean Operators Guide, which uses examples from the If-Then Guide.

InfoView reads logical transactions in your variable formula from left to right, unless parentheses group the transactions differently.

Example: If condition_one AND (condition_two OR condition_three) Then do_this

Without parentheses:

=If [D Dept Code]="AMST" And [CS Course]="102B" Or [CS Course]="100" Then "My Classes"

This will label the following classes as "My Classes"

  • The Course 102B from the department AMST
  • All courses that that have the number 100

With parentheses:

=If [D Dept Code]="AMST" And ([CS Course]="102B" Or [CS Course]="100") Then "My Classes"

This will label the following classes as "My Classes"

  • The course 102B from the department AMST
  • The course 100 from the department AMST