Sample 62546: Creating display rules based on multiple conditions in SAS® Visual Analytics
Overview
SAS Visual Analytics enables you to easily create a display rule to match a single condition. For example, you might highlight all car makes with an average retail price of greater than $35,000. With just one extra step, you can also create a display rule based on multiple conditions.
This sample explains how to create a display rule to highlight car models that match all of the the following criteria:
- MPG (City) is greater than 16.
- MPG (Highway) is greater than 24.
- MSRP is less than $35,000.
The display rule is then applied to a list table that is showing detailed data.
Here are the high-level steps performed in SAS Visual Analytics Designer:
- Create a new calculated data item that returns 1 when all of the conditions are true and 0 when any of the conditions are false.
- Create the display rule based on the result of the calculated data item.
Note: The sample was created in SAS Visual Analytics 7.4. A similar method can be used in release 8.2 and later.
Create a Calculated Data Item for the Conditions
- On the Data pane, click the down arrow and select New Calculated Item:
- Use the Boolean IF...ELSE operator to create the conditional expression as shown in the following display:
Tip: The calculated data item is evaluated based on the detail data. If you want to evaluate the rule based on the data displayed in the object, you can create an aggregated measure instead.
Create the Display Rule
- With the list table selected, click the Display Rules tab on the right.
- Click New and then click Expression.
- Select the calculated data item as the Column, and then apply the rule to the Model data item.
Note: Some objects, such as crosstabs, do not enable you to create rules based on hidden columns. In this case, you must display the calculated data item in the object in order to use it in the rule.
The expression is shown in the following display:
Tip: If the list table did not display detailed data, then the rule would specify > 0 instead of = 1.
Results
The following display shows how the list table appears in the modern version of SAS Visual Analytics Viewer:
Documentation Resources
For links to all of the available documentation for SAS Visual Analytics, see the SAS Visual Analytics Product Documentation page.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Date Modified: | 2018-07-01 11:46:23 |
Date Created: | 2018-06-28 13:57:05 |
Operating System and Release Information
SAS System | SAS Visual Analytics | Microsoft® Windows® for x64 | 7.3 | | 9.4 TS1M3 | |
Linux for x64 | 7.3 | | 9.4 TS1M3 | |