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.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 295 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.8K Transform
- 97 SQL DataFlows
- 608 Datasets
- 2.1K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 712 Beast Mode
- 50 App Studio
- 39 Variables
- 668 Automate
- 170 Apps
- 446 APIs & Domo Developer
- 45 Workflows
- 7 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 391 Distribute
- 111 Domo Everywhere
- 274 Scheduled Reports
- 6 Software Integrations
- 116 Manage
- 113 Governance & Security
- Domo Community Gallery
- 31 Product Releases
- 9 Domo University
- 5.3K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 104 Community Announcements
- 4.8K Archive