Using document, data table or column properties in an analysis
A property, especially a document property, can be used as a variable to drive configurations of visualizations and calculations and make them easy to modify by others. Adding a property control that can change the property value to a text area (installed client only) further simplifies the update process. The property controls can be used to give web client consumer users a possibility to change the axes of visualizations or modify the analysis in other ways.
About this task
This section collects different ways that you can use properties to enhance or simplify a Spotfire analysis.
Before you begin
About this task
For example, a document property can be used to specify a column name. This property can then be used to define what is shown on one or more visualization axes, either directly or as a part of a custom expression. By using a property instead of simply placing the column name directly on the axes, you only need to change a single value (the property value) to change all axes where the property is used.
Property expressions can also be used to define a line or a curve. If a property used in expressions is updated, the property will be updated in all currently used locations.
The process to follow when setting up property controls is usually as follows:
- Decide which values in the analysis people should be able to control from the text area.
- Create a property, which can assume these variations in values, and its property control.
- Hook the property to the place where user control is wanted, for example, an axis selector or an expression.
The best way to explain these steps is through examples. They also give you a hint of what is possible to do.
- Handling column selections using a property
This is an example of how you can use a document property to control the column selection of an axis from a text area. - Limiting data using a property expression
In this example, a property expression is used to pick out details for a certain category from a bar chart that is otherwise quite packed with information. The stacked bars show the amounts of protein, carbohydrates, and fat in different items of food. - 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. - Using a property for coloring purposes
The Color by axis in the map chart feature layer below is set to the Members column in the data table to the right. All states have the same color so far, because the Color mode is set to Fixed. Assume you wish to identify states where the number of members exceeds a certain user-controlled value that you specify in a text area. For example, you might want to color all states that have more than 1000 members in green. - Adding lines using a property
You can use a property as the input to a line or a curve. A property value can either be a string expression in itself, or it can be used as a variable in a custom expression.
- Handling column selections using a property
This is an example of how you can use a document property to control the column selection of an axis from a text area. - Limiting data using a property expression
In this example, a property expression is used to pick out details for a certain category from a bar chart that is otherwise quite packed with information. The stacked bars show the amounts of protein, carbohydrates, and fat in different items of food. - 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. - Using a property for coloring purposes
The Color by axis in the map chart feature layer below is set to the Members column in the data table to the right. All states have the same color so far, because the Color mode is set to Fixed. Assume you wish to identify states where the number of members exceeds a certain user-controlled value that you specify in a text area. For example, you might want to color all states that have more than 1000 members in green. - Adding lines using a property
You can use a property as the input to a line or a curve. A property value can either be a string expression in itself, or it can be used as a variable in a custom expression.