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

  • GrantSmith
    GrantSmith Indiana 🔴

    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?

  • GrantSmith
    GrantSmith Indiana 🔴

    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.

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

  • jaeW_at_Onyx
    jaeW_at_Onyx Budapest / Portland, OR 🟤

    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.

This discussion has been closed.