Conditional expression examples
You can customize any of the standard reports in Accounting CS or create your own reports from scratch using the Report Designer. Adding conditional expressions to a report lets you include or exclude specific data based on certain criteria. The following accounting report examples include commonly used conditional expressions.
Example 1: Exclude zero-balance accounts (all or no activity)
Account Groupings report
To exclude all zero-balance accounts, clear the
Print zeros
checkbox in the Row Properties for the account detail row.Use the following steps to exclude only zero-balance accounts without activity.
- Select row 8 in the Account Groupings report and create the following expression shown in the following example.

- Select row 6 in the Account Groupings report and insert the following conditional expression to exclude the account group heading when there's no activity.

- Repeat step 2 and select the following rows in the Account Groupings report to prevent the remaining headers, footers, and blank rows from printing when there's no activity in the account detail row.Row numberCondition to testAction7RowCount(8) > 0If true, print: 7 through 718RowCount(8) > 0If true, print: 18 through 1919RowCount(8) > 0If true, print: 18 through 1920RowCount(18) > 0If true, print: 20 through 2121RowCount(18) > 0If true, print: 20 through 21
Example 2: Exclude account detail and display balances in subcode row
Account Groupings report
To exclude account detail and show balances in the subcode row instead of with each account, use the Report Designer to change the report as follows.
- Mark theOptional sectioncheckbox and enter aSection namein the Row Properties for each row in the repeating group for accounts.
- Add new rows under the existing account details that are set up to be alternate subcode rows. These rows should include the balance subtotals.
- Create conditional expressions for the alternate subcode rows to print only if the optional account detail row has aRowCount < 1.
Example 3: Separate debit and credit columns (using total balance)
Trial Balance (Condensed, Detailed, and Segmented) reports or Trial Balance Worksheet report
Use the following procedure to separate debit/credit columns using a conditional expression.
- Copy and paste an existing balance column to add other balance columns.
- Create conditional expressions for the amount cells to print only if the amount variable is >= 0 (for the debit amount cell) and to print only if the amount variable is < 0 (for the credit amount cell).noteTo display the credit amounts as positive values, place the mouse pointer in the credit amount cell and selectFormatthenCells, select theFormattab (Amount category), then mark theMultiply by -1checkbox.
- Update *OUT OF BALANCE* conditional expression to print when a variance exists between debit and credit column totals.
- Update the column heading text, as needed.
Example 4: Separate the P&L and B/S columns
Trial Balance Worksheet report
Use the following procedure to separate the P&L and B/S columns using conditional expressions.
- Copy and paste an existing balance column to add more balance columns in the Trial Balance Worksheet report.
- Create a conditional expression in the report that prints the amount variable in the P&L column only ifChartofAccounts.Accounts.TypeCode = "R" Or ChartofAccounts.Accounts.TypeCode = "E".
- Create a conditional expression in the report that prints the amount variable in the B/S column only ifChartofAccounts.Accounts.TypeCode = "A" Or ChartofAccounts.Accounts.TypeCode = "L" Or ChartofAccounts.Accounts.TypeCode = "Q".
- Update the *OUT OF BALANCE* conditional expression to print when a variance exists between debit and credit column totals.
- Update the column heading text as needed.
Example 5: Include items that meet a specific threshold
Trial Balance Variance - 2 Year or 5 Year Comparison reports
To include items that meet a specific threshold, use the Report Designer to change the report and set up conditional expressions to print only the rows based on a specific change in dollar amount and/or percentage.
For example, for a $500 threshold in the
By Account Number
region, create a conditional expression in the report that prints the account detail row (row 4) only if I4 <= -500 Or I4 >= 500
.