The Text object is one of the most versatile objects in SAS Visual Analytics. It can be used to display both static and dynamic text. Some static text use cases include report instructions, annotations such as report author, update frequency, table source name, and explanatory text.
To demonstrate some of the dynamic text use cases, I built a sample report where I use the Text object to incorporate the following elements:
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
Like other objects in SAS Visual Analytics, if you want the object to return a data item value, it must be assigned to a Role in the object. Once Roles are assigned, then the Text object will use that data source’s data items only and you cannot have a different data source’s data items contribute to the Text object.
The exception is parameters. For those familiar with SAS Visual Analytics, recall that parameters are not tied to a single data source but are actually part of the report, and available across the report’s pages.
Let’s take a look at how I configured each of these objects. The dynamic text elements are in the blue bold font in this example report.
Let’s take a look at how we configured the Text object that is surfacing the report title, a parameter and the interactive filters.
Parameter Link
First, we need to store the value we want in the parameter. In this example report, we will use the Transaction Year drop-down that is a report prompt and store the selected value in the parameter named Transaction Year Parameter. With the drop-down control object selected, use the Actions pane to create the parameter link.
Interactive Filters
In order to be able to surface the Interactive Filters dynamic text, the report page must be configured to use Automatic One-way filters. By default, the Display filter breadcrumb is selected but since I want to include the interactive filters in my Text object and I don’t want it display twice, I will deselect it for this example.
To configure, make sure you have the page level selected, then in the Actions pane, select Automatic actions on objects.
Note: If you were to select Two-way filters then you cannot deselect the Display filter breadcrumb option and the breadcrumb option is not available for Linked Selection.
Text Object Configuration
Now let’s configure the top Text object.
When you add a new Text object to the report canvas, the first thing is to assign any measure or parameter values. It is easier to add static text around the dynamic elements. So, using the Roles pane, select the Transaction Year Parameter.
Now we can open the Text object for the rest of the configuration. Double click inside the object or you can use the toolbar menu and select Edit.
Next, place your cursor on a new line and use the Data drop-down menu and select Interactive Filters.
Now you can go in and add in the static text around the dynamic elements. You can adjust the alignment, font size, style, and color. Notice in my example, I made all of the dynamic elements bold blue so you can easily spot them.
Once you are happy with your edits, click OK to close the editor. When you click close and look over at the Roles pane, you may be surprised to see that the measure Frequency is now showing as assigned to the measure role.
Don’t panic, this happened automatically when you added the Interactive Filters from the Data drop-down. Recall that parameters are a report level data item but all other data items, categories and measures, are tied to a single data source. Therefore, since we will be displaying interactive filters, this Text object needs to know what data source it will be tracking and by adding Frequency, which is not shown, it is now tied to the data source.
Parameter, Measures and Display Rules
Let’s take a look at the second Text object in the report which surfaces a parameter, three different measures, one of which has Display Rules defined.
Measures
The only thing you need to do is make sure you have the correct formats and aggregation types set for your desired measures. We will be using the report filter for Year and the Automatic One-way filters on the page to do the filtering of our measures for us.
Notice that the Text object can return both the standard measure and aggregated measures.
Text Object Configuration
Like before, it is easiest to first add the dynamic elements then go in and add the static text around it. Add the new Text object and then assign the Roles in the order we want. You can always move them around but it’s easier if you know the order. The numbers next to each data item represents the order in which I added them to the Text object.
Next, edit the Text object by either double clicking on the object or using the toolbar menu. Add in the static text and then format the position, font style and color as you like.
Display Rules
In this report example, I create a display rule for the Vendor Satisfaction measure with the following criteria:
Use the Display Rules pane then select New rule and click Vendor Satisfaction.
Then define the first display rule. You will need to create three separate rules to incorporate our desired behavior.
Repeat creating a new rule for each display rule criteria.
For more information about Display Rules refer to this article: SAS Visual Analytics Display Rules: Graph – Level. The Text object would behave similarly to the Graph-Level Expression based Display Rule.
For the last Text object in the report, let’s look at how we can configure it to display the Table Modified Time.
Text Object Configuration
Open the Text object and then use the Data drop-down and select Table Modified Time. This will add the dynamic text to the editor.
Then enter the static text around the dynamic element and format the text as desired.
Conclusion
Now you know how to add several dynamic elements to the Text object. You did not miss the coverage for adding category data items to a Text object. Since the Text object aggregates the data based on any prompts or filters, we do not have a way yet to return an aggregation of category data values. There is one exception, you can use a character parameter that has been linked to a control object.
Therefore, the dynamic elements that the Text object can support are:
If you are using an older version of SAS Visual Analytics, you can refer to this article: Using Dynamic Text in a VA 7.4 or 8.2 Report.
Additional articles using SAS Visual Analytics Automatic Actions:
Find more articles from SAS Global Enablement and Learning here.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.