Barchart with a series of 2 different types (sorting issue)

Reply
Highlighted
Yellow Belt

Barchart with a series of 2 different types (sorting issue)

Hi,

 

I've build a bar chart where I can see sales by sales person. I have a beastmode variable that calculates sales and I dragged into the Y-Axis field and I put into the series field a product field that allows me to distinguish between food and drink items.

Now I am trying to sort the bar by sales descending, but it only sorts by one of the items. Meaning that the order is true if just focusing on sales of food items, but not if you look at food item and dirnk item aggregated. Anyone an idea of what is going on??

 

Thanks in advance !!

Highlighted
Major Red Belt

Hi @user084060 

 

Could you post some anonymized examples of your chart to give a better understanding of what you're seeing compared to what you're expecting?

 

Is my understanding correct in that you have the sales person on the x-axis and the sales amount on the y-axis with the type of product as your series?



**Was this post helpful? Click the heart icon**

**Did this solve your problem? Accept it as a solution!**
Highlighted
Major Red Belt

Thinking about this some more, it's likely because Domo is treating your two series data points as separate rather than treating it as a single total over the sales person. You could utilize a window function to get the sum for each salesperson irregardless of the product type.

 

SUM(SUM(`sales_amount`)) OVER (PARTITION BY `sales_person`)

And then toss that into your sort. This is assuming `sales_amount` is the sales amount field and `sales_person` is the sales person field. You'll likely need to rename these to your correct columns.

 

You'd need to make sure you have window functions enabled in your instance. If you don't talk with your CSM as it's just a feature switch.



**Was this post helpful? Click the heart icon**

**Did this solve your problem? Accept it as a solution!**
Highlighted
Yellow Belt

I tried that and it still seem not to sort the overall volume, but only by the volume of one of the items.

I edited my initial post, I hope that helps?!

Highlighted
Black Belt

post data and a screenshot that shows your settings.  I'm pretty confident (without having tested 😉 that @GrantSmith 's window function should work if you sort by it.


Jae Wilson
Check out my Domo Training YouTube Channel

**Say "Thanks" by clicking the heart in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"
Announcements
Domopalooza 2021 Call for Presenters: We want to hear how Domo is revolutionizing the way you do business!

Click here to submit your story.