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.9K Product Ideas
- 1.9K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 303 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 104 SQL DataFlows
- 638 Datasets
- 2.2K Magic ETL
- 4K Visualize
- 2.5K Charting
- 766 Beast Mode
- 69 App Studio
- 43 Variables
- 714 Automate
- 185 Apps
- 460 APIs & Domo Developer
- 55 Workflows
- 14 DomoAI
- 39 Predict
- 16 Jupyter Workspaces
- 23 R & Python Tiles
- 402 Distribute
- 116 Domo Everywhere
- 277 Scheduled Reports
- 9 Software Integrations
- 134 Manage
- 131 Governance & Security
- 8 Domo Community Gallery
- 44 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 111 Community Announcements
- 4.8K Archive