Conditionally Roll Up a Value
There are two ways to conditionalize values in your report:
- Only Rollup If parameter of a calculation
- Conditional calculation
- Replace calculation
Option 1: Only Rollup If Parameter
Most calculations will have a parameter named Only Rollup If. You can edit this parameter to have any condition you need that specifies whether you want the calculation value to apply. For instance, let's say you had a calculation that calculates the total price. You could edit the Only Rollup If parameter to specify that you only want the total price to apply if the customer has paid on time. Once you set the condition, then the total price will only have a value if the condition is met.
Option 2: Conditional Calculation
You can add the Conditional calculation in most cases using the Quick Starts. See Turn Row Values into Column Values.
You can also add the Conditional calculation manually:
Click the
Calculation Editor button on the main toolbar.
Type Conditional under Type of Calculation.
On the Parameters tab, enter values as follows:
Parameter | Effect |
---|---|
Value if within criteria | A grid column value or literal value to pass through if the filter criteria is met. This is normally the column you want to selectively roll up. |
Value if outside criteria | Usually 0 or blank. This is the value that is used in the rollup when the criteria is not met. |
Filter Criteria | Enter one or more filter criteria to define what conditions you want to roll up. For instance, if you want to roll up the amount where LT = AA, enter LT in the field box and AA in the value box. You may use any valid filter to define your criteria. |
Option 3: Replace Calculation
The replace calculation is a good option when you have many cases that you want to substitute for another value. See Substitute Patterns of Text with a Label for more information.