How to use more than one filter in a Configuration Block in Spotfire.

How to use more than one filter in a Configuration Block in Spotfire.

book

Article ID: KB0080229

calendar_today

Updated On:

Products Versions
Spotfire Developer All Versions

Description

A configuration block configures the initial state of an analysis. It has two sections: a list of parameter assignments and a list of configuration statements.

Parameterizing an analysis means to inject parameters into the process of opening the file, and optionally configure the analysis further before it becomes interactive to the user. Both actions are defined in a configuration block.
 

A configuration block is a script-like piece of text. In the following example, the first two lines are parameter assignments, the following lines are configuration statements:
 

Region = "West";
Acme.Limits = { 10, 100, 1000 };
SetPage(pageTitle = "Overview");
ApplyBookmark(bookmarkName = "UserRegionOnly");
SetFilter(tableName = "Table 1", columnName = "Column 1", values = { "A", "B" });
SetMarking(tableName = "Table 2", whereClause = "Gender = 'Male' AND GeekFactor = 'High'");

Parameter assignments and configuring statements are applied when an analysis containing a configuration block is opened.
  • Parameter assignments are used for parameterized analyses, analyses containing data sources, Parameterized Information Links or transformations with parameters.The parameters come into scope before data is loaded. They can be retrieved via the API at any time. Parameters assignments are mandatory whenever the analysis makes use of parameters.
  • Configuration statements consist of a method name followed by an argument list.  Configuration statements are interpreted after data has been loaded, but before the command history is activated. When the configuration statements have been interpreted, they are discarded.  Configuration statements are always optional. Nothing in an analysis requires configuration statements to be defined.
In the API, a configuration block is represented by a text property in the DocumentOpenSettings and DocumentSaveSettings classes, which are used by the AnalysisApplication.Open and AnalysisApplication.Save methods respectively.

Issue/Introduction

Syntax on how to fetch multiple values via configuration block in Spotfire

Resolution

The above example only shows how to configure a configuration block with one filter. In order to configure a configuration block with more than one filter setting, the multiple SetFilter() calls can be separated by a semi-colon (;).

 

Here is the syntax and an example on how to configure a configuration block URL which has more than one filter setting:


Syntax:
  • SetFilter(filteringName="filteringScheme",tableName="tableN",columnName={"columnName1"},values={"String1","String2"});SetFilter(columnName={"columnName2"},values={Int1,Int2});
Example with two columns:
  • http://webplayerserver/ViewAnalysis.aspx?file=/Path/AnalysisName&configurationBlock=SetFilter(filteringName="filteringScheme",tableName="tableN",columnName={"columnName1"},values={"String1","String2"});SetFilter(columnName={"columnName2"},values={Int1,Int2});

Additional Information

Wiki: Create a Configuration Block in TIBCO Spotfire KB: 000021316 How to pass a configuration block to a Web Player analysis file