How to Create a Dynamic Filter in a Text Area in TIBCO Spotfire

How to Create a Dynamic Filter in a Text Area in TIBCO Spotfire

book

Article ID: KB0070558

calendar_today

Updated On:

Products Versions
Spotfire Analyst All

Description

Setting property values through expressions you can create a dynamic filter which uses only some of the values from the original filter and use it to limit data in a visualization.

Issue/Introduction

Using a drop down control with the property values set via expressions, we can create a dynamic filter and use it in the Limit Data Expression of a visualization.

Environment

All

Resolution

Consider a Column CarMake with the following values. 
CarMake
Honda
Ford
Tesla
Jaguar
BMW

Say we want to create a dynamic filter with only three of these car makers. The out of the box "Insert Filter" option available in a text area does not allow us to filter the values to display to the user. Here we can make use of a property control and make use of expressions to set values to achieve the desired result.

Steps to create a dynamic Filter:

1. Create a new, or in an existing Text area add a new Property Control of type Drop-down list, say "dynamicFilter".

2. Set the property value through Expressions.

  The expressions you list should evaluate to boolean true or false. for example, 
  To include Tesla rows use [CarMake] = "Tesla"
  To include Jaguar rows use [CarMake] = "Jaguar"   and so on
  The expressions would look something like - 

User-added image
  
3. On the Data page of the required visualization's Properties, scroll down to Limit data using expression and click Edit...

4. From the "Available Properties for column", double click the name of the Document Property created ("dynamicFilter") in step 2 above so that the limiting expression would look like - ${dynamicFilter}

User-added image

5. Test by selecting different items from the drop-down control.

Additional Information

Doc: Details on Property Control Doc: Table Properties – Data