Spotfire® Web Client User Guide

Using a property in a calculated expression

In this example, assume you are trading with foreign countries, and the figures you want to visualize are dependent on the current exchange rates. Then, you can create a property that can assume different exchange rates and include this property in the conversion calculations. Anyone using the analysis can then simply adjust the value of the property to reflect the current exchange rate, and automatic recalculations will take place immediately. Both the property creation and the property value modifications can be handled from a text area.

Before you begin

The functionality described here must be authored using the installed client.

Procedure

  1. Create or edit a text area.
  2. In edit mode, add the property control to the text area. In this example, we add a Slider.
  3. In the Property Control dialog, create the property via New. Give it a name, specify its data type, and a starting value. In this example, we call the property 'ExchangeRate'.


  4. When the property exists and has been selected, you can adjust the appearance of the slider control at the bottom of the Property Control dialog. The total range is defined, as well as the stepwise intervals when dragging the slider.


  5. Click OK when you are done, and Save the text area.
    The property value can now be adjusted using the slider.

Results

You can now use the property to convert the dollar amounts in the data table below to EUR, and add them as a new data column. Select Data > Add calculated column to open the Add calculated column dialog, and enter ${ExchangeRate}*[Amount] in the Expression field (note the syntax).
Now you can drag the slider to the current exchange rate, and the amounts in the added column are automatically converted using the specified exchange rate.