Organize values on X-Axis
Hi All, I am trying to sort my x-axis values on roles (see screenshot attached) not on the default sort options available in Analyzer.
I read a previous note from 2017 that told me to use CASE to sort, so I did:
CASE split_detail
WHEN 'CEO'THEN 1 WHEN 'Head of Business' THEN 2 WHEN 'key management personnel(KMP)' THEN 3 WHEN 'Other Executives/general managers' THEN 4 WHEN 'Senior Managers' THEN 5 WHEN 'Other managers' THEN 6 END
However, when I put this equation into the sort field, it dodn't sort in the way I wanted. Any help is greatly appreciated.
Thanks
Ben
Best Answers
-
Rewrite it like this and ensure that there isn't aggregation on the sort, in the screenshot you have it set to COUNT. It should look like this:
CASE WHEN `split_detail` = 'CEO' THEN 1
WHEN `split_detail` = 'Head of Business' THEN 2
WHEN `split_detail` = 'key management personnel(KMP)' THEN 3
WHEN `split_detail` = 'Other Executives/general managers' THEN 4
WHEN `split_detail` = 'Senior Managers' THEN 5
WHEN `split_detail` = 'Other managers' THEN 6
ELSE 7 ENDIf I solved your problem, please select "yes" above
1 -
thanks for that. I did as you outlined and it almost gets there! See screenshots. The only values that weren't in order were the Senior Manager and Other Manager (which should be in each other's position).
Any ideas?
0 -
Yeah it is because the values are case sensitive. So in the beastmode it doesn't find a match for "Senior Managers" because the "M" is capitalized in the case statement but not in the data, so it places it in position 7 from the ELSE part of the statement. A great way to protect against this is to wrap the values in LOWER() and then type out the text values as all lowercase.
CASE WHEN LOWER(`split_detail`) = 'ceo' THEN 1
WHEN LOWER(`split_detail`) = 'head of business' THEN 2
WHEN LOWER(`split_detail`) = 'key management personnel (kmp)' THEN 3
WHEN LOWER(`split_detail`) = 'other executives/general managers' THEN 4
WHEN LOWER(`split_detail`) = 'senior managers' THEN 5
WHEN LOWER(`split_detail`) = 'other managers' THEN 6
ELSE 7 ENDOne other suggestion would be to change the chart type to be a 100% stacked bar since you are comparing two % values that will always sum to 100%. Line charts are typically used to show trends over time.
If I solved your problem, please select "yes" above
2
Answers
-
Rewrite it like this and ensure that there isn't aggregation on the sort, in the screenshot you have it set to COUNT. It should look like this:
CASE WHEN `split_detail` = 'CEO' THEN 1
WHEN `split_detail` = 'Head of Business' THEN 2
WHEN `split_detail` = 'key management personnel(KMP)' THEN 3
WHEN `split_detail` = 'Other Executives/general managers' THEN 4
WHEN `split_detail` = 'Senior Managers' THEN 5
WHEN `split_detail` = 'Other managers' THEN 6
ELSE 7 ENDIf I solved your problem, please select "yes" above
1 -
thanks for that. I did as you outlined and it almost gets there! See screenshots. The only values that weren't in order were the Senior Manager and Other Manager (which should be in each other's position).
Any ideas?
0 -
Yeah it is because the values are case sensitive. So in the beastmode it doesn't find a match for "Senior Managers" because the "M" is capitalized in the case statement but not in the data, so it places it in position 7 from the ELSE part of the statement. A great way to protect against this is to wrap the values in LOWER() and then type out the text values as all lowercase.
CASE WHEN LOWER(`split_detail`) = 'ceo' THEN 1
WHEN LOWER(`split_detail`) = 'head of business' THEN 2
WHEN LOWER(`split_detail`) = 'key management personnel (kmp)' THEN 3
WHEN LOWER(`split_detail`) = 'other executives/general managers' THEN 4
WHEN LOWER(`split_detail`) = 'senior managers' THEN 5
WHEN LOWER(`split_detail`) = 'other managers' THEN 6
ELSE 7 ENDOne other suggestion would be to change the chart type to be a 100% stacked bar since you are comparing two % values that will always sum to 100%. Line charts are typically used to show trends over time.
If I solved your problem, please select "yes" above
2 -
Hi Colemen
It isn't working for me, see screen shots attached.
The reason why I use a line chart is because it is an industry-standard way of presenting the difference in male/female management roles on a seniority
basis.
ANy help appreciated.
BEn
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive