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 may also want to define a custom sort order, if the strings in the column have a hierarchical structure that is not alphabetical.
- In the Data panel, click on the column of interest and click on the Expand data panel for tools and details button, .
In the expanded data panel, locate the
Sort order section and change the sort order. If you select a
Custom sort order you also need too click on the
, and define the custom sort order.
See below for examples.
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:
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:
The resulting order in the visualization will then be: