Data Limiting With Expressions

Welcome to part 5 of my Spotfire Data Limiting Series. The first post in the series covered data limiting with the filter and data panels. The second post talked about data limiting in the web player. The third post discussed limiting using filtering schemes. Last week, I covered limiting with marking. Now, we are on to limiting with expressions. As a new Spotfire user, I was enamored with filtering schemes, but as my skills developed, limiting with marking became my go-to method.

I’ll begin this post with a brief explanation of data limiting with expressions. Then, I’ll show you how to set it up. Finally, I’ll explain when to use it and when not to use it.

What is Data Limiting with Expressions

Data limiting with expressions is a way to limit the data shown on individual visualizations with a boolean formula. The user writes an expression where the result is either true or false. Only data that is true is returned in the visualization.

The big benefit to using data limiting with expressions is that filtering and marking have NO IMPACT on the data limiting. Even if a user accidentally resets all filters, the visualization stays the same.

Setup

Limiting with expressions is configured in Visualization Properties > Data menu > Limiting with expression subsection, as shown below.

In this example, I want to return data where the StageAdditiveType equals “water” or “slickwater”. Note, limiting with expressions only works where the result is true or false.

With that said, you can use data limiting with case statements or if statements as shown in this example.

When To Use Limiting with Expressions

  • Use when you are worried about users resetting filters.
  • Limit with expressions when you don’t need details visualizations (data limiting with marking), but you still want to limit what is shown.
  • If you don’t want to mess with filtering schemes or find them cumbersome, as I do.
  • When the data to be limited doesn’t depend on the individual user.
  • If data limiting can easily be defined by a boolean statement.

When Not To Use Limiting with Expressions

  • If the data to be limited DOES depend on the individual user.
  • When limiting cannot be simplified to true or false. For this scenario, use limiting with rules, which is coming soon in the data limiting series.
  • When you have a lot of visualizations and/or the data limiting might change and the rework isn’t worth it. (I use the “isn’t worth it” qualifier because I still use this method even when there is uncertainty).

Recommendations for Use

  1. Document the use of data limiting so that users or other developers do not have to open up the properties dialog for every single visualization.
  2. Make sure limiting by expression is shown in the legend so users or other developers know that functionality is being used.

In summary, data limiting with expressions is one of my favorite methods, and I use it in almost every project I build.

Spotfire Version

Content created with Spotfire 10.2. (Yeah, upgrade!)

10 thoughts on “Data Limiting With Expressions”

  1. Pingback: Data Limiting In Spotfire • The Analytics Corner

  2. Pingback: Creating a Snapshot of Yesterday with Expressions » The Analytics Corner

  3. Pingback: Part 6 - Data Limiting with Subsets » The Analytics Corner

  4. Pingback: Part 7 - Data Limiting with Rules » The Analytics Corner

  5. Pingback: Error Reporting with Alteryx & Spotfire » The Analytics Corner

  6. Pingback: How to Use Axis Names in Spotfire Cross Tables » The Analytics Corner

  7. Pingback: Using Document Properties to Control Data Limiting by Expression » The Analytics Corner

  8. Pingback: Using Input (multiple lines) Property Controls in Spotfire Text Areas » The Analytics Corner

  9. Thanks Julie for this great blog.

    is it possible to use both limit data using expression and filtering schema. Currently, I’m trying to do so, but it’s showing (page filtering ignored).

    1. Yes, this can be done but I don’t recommend it because it can be very confusing for the user. Just uncheck the box and check one of your filtering schemes.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.