This is the second post in a series about the available Display Rules in SAS Visual Analytics.
Recall from the first article, that there are three types of display rules. Here are examples for each type.
The conditions are defined in the Rules pane. These Boolean expressions are evaluated for each visualization based on the assigned data Roles.
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
SAS Documentation: Working with Display Rules.
In this article, we will cover the Table – Level Display Rules. There are two types of table objects in SAS Visual Analytics, the List Table and the Crosstab. Here are the available Display Rule types that each table object supports:
List Table | Crosstab |
---|---|
|
|
The List Table Object is one of the most feature rich objects. I cover several of these features in this article, Get to know the List Table. From the above list, we can see that the List Table supports all three types of Display Rules. Let’s look examples of each.
List Table – Color-mapped Value Display Rule Here are the steps to define a Color-mapped Display Rule for a List Table:
That means, this Display Rule color-mapped value condition will only be applied to the Product Line data item. This is different from a Report-Level color-mapped value condition as it is applied to any category data item in any data source in the Report. If I had selected Any Category in this rule definition, then it would behave similarly to the Report-Level where it would try to apply the rule for any category but only in the selected List Table and thus only the data source feeding the List Table.
In this example, my List Table only has two Roles assigned: Product Line and Profit. The available Placement choices will be to apply the coloring to the entire Row or only to a selected column.
Here is how each of those Placement positions would look in this example List Table for a Color-mapped Value Display Rule.
List Table – Expression Display Rule To define an Expression Display Rule for the List Table Object, you start with the same steps:
Next we must define the Display Rule Expression. Let’s walk through these steps.
Here is how each of those Placement positions would look in this example List Table for an Expression Display Rule.
Pro Tip: Notice that this List Table Expression Display Rule uses a column in the data source that is not assigned to the List Table Roles. This is an incredibly powerful feature of the List Table.
List Table – Gauge Display Rule
The Gauge Display Rule for List Tables adds an additional visualization in line with each row. There are four gauges to select from and the display rule allows for a custom interval definition. Here are the available gauge types:
Here is how to define a Gauge Display Rule
Now we must define the gauge expression:
Here are how all of the available gauges look for the same measure, Expenses, and with the same interval definitions.
Crosstab
The Crosstab is our second Table Object available in SAS Visual Analytics. Similar to the List Table in its popularity, it has a different purpose when visualizing data. The Crosstab Object is able to present hierarchical data items in a visually attractive way. You can assign a Hierarchy data item to either the Rows or Columns or you can just add multiple category data items and the Crosstab will handle the hierarchical display. If you use a hierarchy data item then the expand, collapse, and drill navigations are available. The Crosstab also has Options to display Subtotals and Totals or switch the orientation of where the measures are placed.
But let’s talk about the available Display Rules for the Crosstab Object. The Expression Display Rule is the only type of rule supported. Now, before you become disheartened, the Crosstab (and the List Table) Object has two Cell Visualization Options available that can be used to enhance each cell which both add richness to the visualization. See my blog, Use SAS Visual Analytics Cell Graphs to enhance List Tables and Crosstabs or my YouTube, Add Cell Graphs to List Tables and Crosstabs in SAS Visual Analytics, for additional examples.
Back to our Expression Display Rule for the Crosstab. Let’s start with the final result for this one. Here you can see the Crosstab Object and below you can see the Roles and Rules panes.
When defining the Expression Display Rule for a Crosstab, the option to define an intersection of where the rule is to be applied is unique to this object. This means that the Boolean expression will only be evaluated at the specified intersection and the display rule formatting will only be applied to those cells. If there is no intersection defined, then all cells in the Crosstab will be evaluated and formatted if they meet the display rule condition.
Now let’s dive into the details. First up, is the cells that have the font color red. This Expression Display Rule is intended to color the font red if any of the cells are less than zero. To define this rule:
Then you must:
In the screenshot below, I’ve used a red square in the first row to show how all of the cells where the display rule evaluates to true, the font color is now red. This applies to all cells, regardless of the intersection.
Now let’s take a look at one of the display rule definitions for a specified intersection. You can then repeat similar steps for the other display rules in this example. Notice this time we select Expenses and not Any Measure.
In this display rule, we will have to specify an intersection.
In the screenshot below, I’ve used a red square to show how only the cells where the display rule evaluates to true and only at the intersection: Facility Region / Product Line / Date by Year / Date by Quarter are formatted with the red background.
You can also use Display Rules to assist when defining a scope for an aggregated measure. See my blog, SAS VA Report Example: Add a scope to an aggregated measure or YouTube, SAS Demo | Add Scope to an Aggregated Measure in SAS Visual Analytics for more information.
Pro Tip: Notice that unlike the List Table, the Crosstab Expression Display Rule only allows for you to select measure data items that are assigned a Role in the object to use in the Value comparison.
One of the major benefits of Display Rules is that we can layer several rules on a single object. This can; however, lead to unexpected results. If you have multiple Display Rules for the same element, then the winning rule is the one at the top of the list.
Depending on the type of object, List Table or Crosstab, the type of Rule will determine how you can reorder and layer the rules. For all of the details, see SAS Documentation: Reorder Display Rules.
I’ve included an example for both the List Table and the Crosstab to demonstrate some of the layering results.
I hope these List Table and Crosstab examples have given you lots of ideas you can use in your VA Reports.
This is the second article in the series.
In the interim, here is a List Table Object using the Gauge (Icon) Display Rule summarizing the supported combinations of Display Rule type and Object level. This summary table will build out as we continue the series.
Here is a list of the supplemental enablement materials I mentioned in this article as well as other helpful resources:
Find more articles from SAS Global Enablement and Learning here.
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.