Conditional
Description
Allows for "If/Then/Else" logic to be used to produce a true or false result.
Calculation Editor
If
Field | Criteria | Filter or Chain | Required |
---|---|---|---|
Column Value Input | Literal (utilize valid filter syntax) | Filter | ✔ |
Note
The Chain option allows AND or OR criteria to be added if advanced condition logic needs to be met in the calculation. If two rows of filters are included in the IF section, they are assumed to be joined by an AND criteria automatically.
Then
Input | Input Field | Required |
---|---|---|
Value if true | Column or Literal | |
Multiply by | Column or Literal | |
Add | Column or Literal | |
Value if false | Column or Literal | |
Multiply by | Column or Literal | |
Add | Column or Literal | |
Treat empty as BLANK | Check Box |
Remarks
- The caption of the conditional will be the same as the grid column mapped to the 'Value if true' setting. If it is a literal, the caption will be the text of the literal.
- Treat empty as BLANK indicates that if the criteria is blank the condition is effectively ignored. If checked, the value must match blank for it to be true.
- Conditional calculations can be easily converted to Formulas, making it easier to implement more advanced logic like nested if statements.
- The Replace Calculation is a great use of conditional logic as well.
- There are certain Trend Wizards that utilize the conditional calculation to produce the desired output. See Turn Row Values into Column Values.
Example
Let's say you want to conditionally label a row as "High Priority Check" when the Gross Amount for a customer is above $10,000.
- Select Design > Calculations > Conditional
- Fill in the criteria:
- If:
- Field = Gross Amount
- Criteria = > 10000
- Then:
- Value if true = High Priority Check (this is a literal value)
- Value if false = <BLANK> (there should be nothing here - a blank literal value)
- If:
Ensure the Type of calculation is set to String
Note
Default return type for a conditional is a decimal. While this is more frequently used, the example here demonstrates a need for the return type to be changed to string.
Select Save and Close
- View output - Confirm that any gross amount records greater than $10,000 have a value of "High Priority Check"