TIBCO Spotfire:A Comprehensive Primer(Second Edition)
上QQ阅读APP看书,第一时间看更新

Spotfire custom expressions

So far, we have selected columns and aggregation functions on visualization axes. These are selected by the (now familiar) axis selector dropdowns. Behind the scenes, Spotfire is translating the selections made by you into an "expression." This expression determines how Spotfire aggregates or displays the data on a visualization.

It's possible to see the expressions behind the visualizations by right-clicking on an axis selector on a visualization or a visualization property page. For example, if we revisit the KPI chart we just created, we can see the expressions that drive the data that is shown. It's then also possible to customize any of the expressions therein.

A simple example of an expression is as follows:

Avg([Close])

What does this represent in Spotfire? Simply put, Spotfire will calculate the average of the Close column and display it. You can access the expressions wherever you see an axis selector. For the preceding KPI chart, try right-clicking on the Value (y-axis) selector and clicking Custom Expression...:

In Analyst clients, you'll see the full expression editor pop up:

Study the dialog brieflythe individual parts of it will be discussed in more detail later on. We will be using a custom expression in the next example.

In the web client, the expression editor is simplerit doesn't have so many options or hints to help you, but it's only designed to enable editing of simple custom expressions: