TIBCO Cloud™ Spotfire® Web Client User Guide

Changing the default sort order of values in a column

Text-based columns (strings) can be sorted differently depending on whether you want digits in the texts to be treated as numbers or to be sorted strictly alphabetically. You might also want to define a custom sort order, if the strings in the column have a hierarchical structure that is not alphabetical.

Before you begin

You must have some data loaded in the analysis, and the analysis must be in Editing mode.
Note: You can only change the sort order for text-based columns.
Tip: In the flyout, you can also right-click the column of interest and select Sort order from the pop-up menu.

Procedure

  1. On the authoring bar, click Data in analysis and click on the column of interest.
  2. In the expanded flyout, make sure that Details on selected column is selected.
  3. In the expanded flyout, locate the Sort order section and either change the sort order directly from the drop-down list or click SettingsSettings button. and make further modifications in the Sort order dialog as described below.
  4. In the Sort order dialog, click the sort order type of interest to the left.
    A sample of the selected sort order is shown in the list to the right. If you select a Custom sort order you can define the custom sort order to use by moving values up or down in the field to the right.
    Alternatively, you can also Copy sort order settings from another column in the analysis, by expanding the section at the bottom of the dialog and choosing a column to copy the sort order from.
    See below for examples of sort order settings.
  5. When you are done, click OK.

Results

When you have defined a new sort order for a column, this is the default sort order that will be used at all places where the column content is shown.

Example: Standard alphabetical sort order

By default, all text-based columns will be sorted alphabetically. This means that digits and non-alphanumeric characters will be sorted according to their position in the alphabet. The following values will be sorted as seen below:

a#
a1
a20
a3
b1

The number 2 comes before the number 3 in the alphabet, so a20 comes before a3 in the list.

Example: Alphabetical (natural sort of numbers)

If the digits included in the texts should be treated as numbers, you would instead use the alphabetical sorting with natural sort of numbers:

a1
a3
a20
a#
b1

Then, the value a20 will be seen as a higher number than a3, as shown above.

Example: Custom sort order for column with priorities

If your data contains values that you want to display in a certain order, you can define a custom sort order for that column. For example, with a column called 'Priority', containing four different values, the default sort order would give the following result:

Priority column with default sort order.

If you instead want the bars to be in an order from Low to Critical, you can set up a custom sort order for the Priority column by moving the values up or down in the Custom sort order dialog using either the Move up/Move down buttons or drag-and-drop:


Custom sort order dialog.

The resulting order in the visualization will then be as follows:

Priority column with custom sort order.