When sorting dimensions in Chartio, by default all columns are sorting ascending and in the order they are listed in the Dimensions box. Measures always take precedence over Dimensions, but sometimes you want to first sort something in the Dimensions box and then by an item in the Measures box, for example running a query that sorts by date and then by user.
There are two solutions to this problem:
- Edit the SQL and change the order of the sorted columns in the ORDER BY clause. However, this will disconnect you from using Interactive mode anymore for this chart.
- Add a sorting step in the Data Pipeline; you will be able to re-sort all of the resulting columns in your query in any direction and order.
Hover over the chart and click on the ellipsis in the upper right hand corner and click Edit Chart Data. Scroll down and click +Add Transformation in the Pipeline.
Choose the fields and the order (ascending or descending).