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 !!

Comments

  • 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 Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • 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 Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • 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?!

  • 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 ❤️ in the post that helped you.
    **Please mark the post that solves your problem by clicking on "Accept as Solution"
This discussion has been closed.