Product: TIBCO Spotfire®
How to change the sort order of items in visualizations in TIBCO Spotfire
Often there is the need to reorder the values in visualizations in TIBCO Spotfire so that they appear in a specific required order. For example, it might be needed to re-order the values in the "Color by" axis on the legend, the order of stacked or side-by-side bars in Bar Charts, or the order of values in headers in Cross Tables and other locations.
The order of all of these values in visualizations is determined by the sort order of the particular column (Integer columns use the ascending numerical sort order, string columns use alphabetical, etc). Each data type has its own default sort order, but for strings you can also define custom sort orders where you can manually order the values in any order desired.
To do this, define your own custom sort order for the column in the Custom Sort Order dialog:
- Select Data> Column Properties (or Edit> Column Properties, if you are using Spotfire version 7.14 or older).
- In the Columns and Hierarchies list, click to select the column whose sort order you wish to modify.
- Go to the Sort Order tab.
- Click on the Custom Sort Order radio button, then click on "Configure...".
- Select the values and then use the buttons to reorder the values (move up, move down, move first, move last), reverse the order, or reset the order to the default. Once the order is as desired, click the OK button twice to save the changes.
Note: The Custom Sort Order feature is only available for columns of data type String, so all other data types will always be sorted using their own standard sort order and will not have the option to apply a custom order. To define a custom sort order based on columns with such non-String data types, create a calculated column which converts the value from the original column into a String, then use that new String column in the visualization. To do this you can create a new calculated column with an expression that uses the String() function, such as:
Then you can create a custom sort order on your new calculated column which you then use in visualizations.
Details on Column Properties – Sort Order
Details on Custom Sort Order