Conditional Text Example

In this example, we will set up conditional text to display, for each Entity in the grid rows, specific text for revenue variances with a positive number and different text for revenue variances with a negative number. The text will be surfaced in a text box at the bottom of the report.

The text will display, along with some static text, the row member Entity alias, the Actual revenue value, the variance percent and the percent of revenue to total revenues. The conditions and related text assigned to the Actual vs. Plan Variance % column, will be as follows:

  • Green: Cells with values greater than 0%: MemberAlias("Entities") Revenue of CellValue(A) was CellValue(C) above Plan, resulting in CellValue(D) of Total Revenue

  • Red: Cells with values less than 0%: MemberAlias("Entities") Revenue of CellValue(A) was CellValue(C) below Plan, resulting in CellValue(D) of Total Revenue

In reference to the text functions used in the conditional text:

  • CellValue (A) – returns the Actual Revenue data value for the current row in column A

  • CellValue(C) – returns the Actual vs. Plan % data value for the current row in column C

  • CellValue(D) – returns the % of Total Revenue (report formula column, which is hidden from display) for the current row in column D. This example illustrates that the text functions can refer to hidden rows or columns that are not displayed in the grid output.

    The grid preview is displayed.
    Conditional Text Example

To create the conditional text:

  1. In the grid editor, select the variance % cell, and then click conditional text icon to create the conditional text. For details about creating conditions, see Creating a Condition.
    create the conditional text

  2. Set the condition, as below:

    • For the Green condition, create a conditional format where the Current Cell Value is greater than 0:


      green color condition
    • In the Conditional Text tab, use the function icon to select the required functions and manually enter the static text:


      conditional text
  3. Set the condition, as below:

    • For the Red condition, create a conditional format where the Current Cell Value is less than 0:


      set the color condition
    • In the Conditional Text tab, use the function icon to select the required functions and manually enter the static text:


      conditional text
  4. Edit an existing text box in the report and insert the ConditionalText text function.
    text function dialog

    No additional parameters are needed, as we want to display all conditional text in the text box.


    report body text image
  5. Click preview button to view the report with the text box results.


    preview the report with text box

Displaying Conditional Text in the Grid

An alternate example for displaying the ConditionalText in the grid, instead of the conditional text being displayed in a text box at the bottom of the report, the text results for each Entity row member will be displayed in a text column in the grid.

Note:

Refer to the following grid design, where column E is a text column, which contains the ConditionalText text function. It is retrieving the text for column C (where the condition is applied), for the current row, as no row parameter has been specified.


column E is a text column, which contains ConditionalText text function

Click preview button to view the grid results. You can view the text function results for each row in the text column.


conditional text being displayed in a text box