Have you ever wanted to limit the data displayed in a visualization without using filters?
Most of the time your Spotfire projects have multiple graphs on a page, with each one serving a different purpose. Let’s say you want one of those charts to limit data more than the filter settings, like a specific time period (ex: “This year’s production”).
Your first thought might be to create a new filtering scheme for that chart, but there’s an easier way! Multiple filtering schemes can get cumbersome to keep track of.
Instead of creating a custom filtering scheme for one chart, just limit the data with an expression.
The example below has 2 graphs and a cross table. The bar chart and the table are showing all data. However, the line chart is showing a more detailed view, just of the year 2015.
[ninja-popup ID=1206] Download the Spotfire template shown in the screenshots [/ninja-popup]
How did I do this? By simply limiting the data shown in the bottom graph to the year 2015 with a custom expression.
Options for Limiting Data in a Visualization
In a given visualization, there are several different ways that we can limit data. By “limit data”, I mean “don’t show it on this chart, but show it everywhere else”.
You can limit data with:
- Markings (details visualization)
- Custom expressions
- Show/Hide Items
Steps to Limit Data with an Expression
In my example, I’ve limited data using an expression, specifically when the Year = 2015. To do this, follow the steps below.
- Open the visualization properties (right click on the visualization)
- Click the Data tab
- Scroll down to “Limit Data Using an Expression”
- Click Edit
- Enter your custom expression. The expression I used is: Year([Date])=2015
- Click OK, then Close
That’s it! Play around with different functions in your expressions to show the data you need.
Notice that the legend now has a “Data Limiting” Section to remind you and others that the chart is not displaying all data.
Questions / Comments
If you have any questions or comments, or if there’s something you’d like featured on this blog, feel free to email me at email@example.com or leave a comment below.
[ninja-popup ID=1206] Click Here to download and follow along with the Spotfire example shown in the article! [/ninja-popup]