If you are new to SAS Visual Analytics, and you’ve come across this article, I hope it’s because you’ve searched for how to add a filter to a report. Every tool has its own terminology and SAS is no different. Let’s look at the different ways you can add a filter to your report.
First let’s look at a direct filter applied using the Filter pane. This is a filter that is typically applied by the report designer and is not directly apparent to the report viewer that it is applied.
Basic filter
In this example, I have a bar chart where Year is assigned to the lattice row Data Role and Country is assigned to the group Data Role. In the right-hand screenshot, I have applied a basic filer to only return the Year 1994. This is called a basic filter as it only uses one data item in the Boolean expression.
Notice that in only viewing the bar chart, there is no indication there is a filter applied.
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
Here’s a quick look at the steps to apply a basic filter:
Advanced filter
In this second example, I have the same bar chart where Year is assigned to the lattice row Data Role and Country is assigned to the group Data Role. In the right-hand screenshot, I have applied an advanced filer to return the Year 1994 and the Country Canada. This is called an advanced filter as uses more than one data item in the Boolean expression.
Still notice that in only viewing the bar chart, there is no indication there is a filter applied.
Here’s a quick look at the steps to apply an advanced filter:
Common filter
Once you configure a filter for a single object, you can share that filter with other objects in your report that share the same data source.
I have a dedicated article to this feature and an accompanying YouTube.
The second way we can filter objects in a report, is to prompt the user to select a value. In order to prompt a user, we must use a Control object.
If you place the control object in the report or page prompt area, then a filter is automatically applied to all of the objects in the report or page if the same data source is used or you can configure a data source mapping between different sources. Otherwise, if the control object in in the report canvas, then you must manually configure an Action to filter the target object or objects.
Prompt Type |
Filter Behavior |
Report prompts | Automatically filters all objects in the report, across all pages, with the same data source automatically or can configure data mapping for different data sources. |
Page prompts | Automatically filters all objects in the current page with the same data source automatically or can configure data mapping for different data sources. |
Canvas prompts | Do not automatically filter any objects. A filter Action must be configured. Able to configure data mapping for different data sources. |
I have a dedicated article and accompanying YouTube for Configuring prompts for different data source.
Control objects
Here are the available control objects:
Page prompt
Let’s look at adding a control object to a page prompt so that it automatically filters all of the objects on the page that use the same data source. Refer to the linked article or YouTube for more detail on how to configure prompts that use different data sources.
Now we can test our prompt. In this first screenshot, this is how both objects appear with no filters applied. We can see both years in the stacked bar chart and in the crosstab objects.
When I select the year value 1994, both of the objects are filtered automatically because the control objects is placed in the page prompt area and both objects use the same data source. Therefore, no additional steps are needed.
Canvas prompt
Now let’s add a canvas prompt which will require an additional step, to manually configure the filter Action. I will add it to what we already have in our report, and I will prompt for Product.
Success! Now you can select different values in the list control and watch how both objects get filtered.
I have now shown you two ways to configure a filter for objects in a Visual Analytics report; using the Filter pane or prompting the user to select a value using control objects.
Here is a list of additional resources:
Find more articles from SAS Global Enablement and Learning here.
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.