Category / Section
How to Sort the Bar Charts Using Custom Order Based on Specific Categories
Published:
In some cases, you may want to display a bar chart with a custom sort order based on specific categories. This article will guide you on how to achieve this using an expression.
Steps to Sort Bar Chart with Custom Order
- Create an expression to sort the order as follows:
- Condition: IF([Column_Name]='Exceptional', 1, IF([Column_Name]='High', 2, IF([Column_Name]='Moderate', 3, IF([Column_Name]='Low', 4, IF([Column_Name]='Not Significant', 5, 6)))))
- Replace `[Column_Name]` with the name of the column you want to sort.
- Sort the Column(s) field based on the created expression with Avg aggregation.
- After completing these steps, the Bar chart widget will be rendered with a sort order of Exceptional, High, Moderate, Low, Not Significant, and Not Mapped.