MicroStrategy ONE
Conditional formatting based on the contents of a text field
You can format a text field based on what the text field contains, such as static text, auto text codes (which display information about the document), or dynamic text (such as dataset objects). For example, you can:
-
Display or hide a text field based on the prompt answers for a document. To do so, you create a text field containing the auto text code
{&Prompt
N&}
, as described in Auto text codes for document information. You then define a conditional format to hide the text field if the text field is empty. When the document is run and the user selects prompt answers, each prompt answer is displayed in the text field. If the user does not select any prompt answers, the text field is hidden. -
Display the value of a metric in a text field, and replace that value with a message such as "Revenue target met" when that value is greater than or equal to $5,000,000. To do this, you add dynamic text to a document to display the value of the metric, as described in Adding dynamic data to a document. You then define a conditional format to replace the contents of the text field when the metric value is greater than or equal to $5,000,000. When the document is run, the text field displays the value of the metric for any values under $5,000,000, and displays your customized message for any values greater than or equal to $5,000,000.
Prerequisite
This procedure assumes that you have already created a document that contains the text field to apply conditional formatting to.
To create a conditional format based on the contents of a text field
-
In MicroStrategy Web, open the document in Design or Editable Mode.
-
In the document layout area, right-click the text field that you want to format. Point to Conditional Formatting, then select Advanced. The Conditional Formatting dialog box opens.
To define the condition to test
-
From the Filter On drop-down list, click Selected Text Field.
-
From the next drop-down list, select a comparison operator such as Greater Than or Less Than. To format the text field when no prompt answers are selected, select Equals from the drop-down list.
-
In the field on the right, type the value to compare the contents of the text field to. For example, to format the text field when it contains a value greater than $50,000, select Greater Than from the drop-down list and type
50000
. To format the text field when no prompt answers are selected, leave this field empty. -
Click Apply to create the new conditional format.
-
To add more conditions to a conditional format, select the conditional format, click the Add Condition icon on the toolbar, and repeat the steps above to define each condition, starting at To define the condition to test.
-
If you plan to create similar conditional formats in the document, it can be convenient to make a copy of a conditional format. To copy a conditional format, select the conditional format and click the Copy icon on the toolbar. Then click the Paste icon on the toolbar.
To specify the formatting
-
To specify how data that meets the defined condition is formatted, click the conditional format, then click the Cell Formatting icon on the toolbar. The Format dialog box opens.
-
Specify a name for the conditional format in the Name field.
-
You can replace data with text or a symbol, or hide the object. Select the Replace Data check box and select one of the following from the drop-down list:
-
Replace Text: Replace data with any text that you specify. For example, a document shows the financial values of various sales opportunities. For those sales opportunities that have been lost, you can display the word LOST in red, rather than displaying the financial value. A common use of this option is to display the word EMPTY when a data value is null.
If you select this option, type the replacement text in the field.
-
Quick Symbol: Replace the data with a common symbol. For example, a document shows the financial contribution of various sales groups to overall sales office activity. For the monthly trend column, you can show a green plus + and a red minus - symbol to represent positive and negative contribution trends.
If you select this option, select the symbol from the corresponding drop-down list.
-
Hide: Hide the control. For example, a document displays the names of each sales region for which a user chooses to display data. You can hide the text field containing the region names if the user does not select any sales regions.
-
-
Make selections in the Font, Number, Alignment, and Color and Lines tabs to change the font, color, alignment, and other options for data the meets the defined condition. Click Help for details on each option.
-
Click OK to apply the changes.
-
To determine how to apply conditional formatting if the object that you are formatting is the target of a selector, select one of the following options on the toolbar:
-
To apply conditional formatting only when metrics are selected in the selector, click the Format metrics only icon.
-
To apply conditional formatting for both metrics and the Total option, click the Format metrics and subtotals icon.
-
-
To add additional conditional formats, click the Add Threshold icon, then follow the steps above to define each conditional format, beginning at To define the condition to test.
-
Click OK to apply the new conditional format to the document.
Once you create a conditional format, you can allow users to decide whether or not to display conditional formats. See Displaying or hiding conditional formatting.