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.
To create the conditional text:
-
In the grid editor, select the variance % cell, and then click
to create the conditional text. For details about creating conditions, see Creating a Condition.
-
Set the condition, as below:
-
For the Green condition, create a conditional format where the Current Cell Value is greater than
0
: -
In the Conditional Text tab, use the
to select the required functions and manually enter the static text:
-
-
Set the condition, as below:
-
For the Red condition, create a conditional format where the Current Cell Value is less than
0
: -
In the Conditional Text tab, use the
to select the required functions and manually enter the static text:
-
-
Edit an existing text box in the report and insert the
ConditionalText
text function.No additional parameters are needed, as we want to display all conditional text in the text box.
-
Click
to view the report with the text box results.
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.
Click to view the grid results. You can view the text function results for each row in the text column.