Legend Sort on Bar Chart
Hi,
I have a bar chart where I want the legend to be sorted by the highest total units (from all the y-axis currently shown). Currently, it sorts off of the highest units in one particular client, but I want the legend to show the company with the highest total units on that view at the top. I have circled in red the ideal sort order. Can this be achieved?
Thank you for your time
Best Answer
-
your main axis is client, it's confusing what you expect it to look like given that I assume one company could be distributed across multiple clients.
anyway, try sum(sum(amount)) over (partition by company).
you may need to ask your csm to enable the 'add window functions to beast modes' feature switch.
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"1
Answers
-
your main axis is client, it's confusing what you expect it to look like given that I assume one company could be distributed across multiple clients.
anyway, try sum(sum(amount)) over (partition by company).
you may need to ask your csm to enable the 'add window functions to beast modes' feature switch.
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"1 -
Thanks, @jaeW_at_Onyx !
What field name should I use for "amount"?
I tried the below, but I may be making it more complicated than needed:
SUM(SUM(COUNT(`Item Code`))) OVER (PARTITION BY `Company Name`)
It validated, but when I updated my screen, I got the error: "An issue has occurred during processing. We are unable to complete the request at this time."
I have requested the feature switch as you mentioned.
Thanks!
Angela
0 -
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
0
-
You should be able to get the sort you want with the built in functionality.
In the Chart Properties - General, there are two additional properties that you will want to use in addition to the standard Sorting property:
Sort on Totals
Sort Each Category
Play around with these 3 properties (Sorting, Sort on Total, Sort Each Category) and you should be able to get the sort order in the legend you are looking for.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.1 -
Hi @MarkSnodgrass,
I was hoping the same thing but no luck
This was a drill-down view so maybe that made it more futzy.
The partition beast mode worked though.
Thanks for your help ?
0 -
Hi @jaeW_at_Onyx ,
I adjusted the beast mode to :
SUM(COUNT(`Item Code`)) OVER (PARTITION BY `Company Name`)
and it worked! I was making it too complicated ?
I need to read up on "Partition By" some more.
Thanks so much for your help!
0 -
Glad you found something that works. I have covered window functions so many times on my YouTube channel!
https://www.youtube.com/watch?v=eifSYZIcPzg&t=2247s
https://www.youtube.com/watch?v=39VHAQEYHAc&t=316s
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"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.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 58 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 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