Skip to main content
Skip Navigation LinksHome  Extending the Spotfire Platform  Common Tasks and Idioms  Spotfire Filters  Altering the Lower Limit of a Range Filter

©Spotfire 2011

Altering the Lower Limit of a Range Filter

Code example showing how to change the lower limit of a range filter programmatically.

// There is typically one filtering scheme
FilteringScheme fs = doc.FilteringSchemes.DefaultFilteringSchemeReference;

// There is typically one data table, the default table
// The default filter collection maps to the default table
FilterCollection fc = fs.DefaultFilterCollection;

// Find the filter corresponding to the column you want to manipulate.
string columnName = "Age";
Filter filter = fc[columnName];

// The filter type is determined by column data type and the number of unique values.
// Make sure the filter is a range filter before manipulating it.
filter.TypeId = FilterTypeIdentifiers.RangeFilter;
RangeFilter rFilter = filter.As<RangeFilter>();

// Set lower limit. To do this, the upper limit also must be specified.
rFilter.ValueRange = new ValueRange(10.0, rFilter.ValueRange.High);