Currently, when sorting the column that has text (or string) data type, the order will be sorted alphabetically.
For example, you have the column with 3 distinct values: high
, medium
, low
. If your sort descending, the order will be like below which is unexpected
priority (desc) |
---|
medium |
low |
high |
The correct order should be:
priority (desc) |
---|
high |
medium |
low |
Since the sort is not customizable, you could utilize our business calculation to transform your value into 1-low
, 2-medium
, 3-high
and apply the sort afterward
priority (desc) |
---|
3-high |
2-medium |
1-low |
The sample syntax for transforming the column using business calculation could be
case(
when: your_model.priority == 'High', then: '3-High',
when: your_model.priority == 'Mid', then: '2-Mid',
when: your_model.priority == 'Low', then: '1-Low',
else: 'others'
)