Rank by Sum of Style then Compare Rank to total

Hi,
I have transactional data over periods of time. Data includes dates and time periods as well as SKUs and Net sales. I want to be able to dynamically rank SKUs based on net sales to create a top 10 group and then compare that group to the total sales for the category.
Trying this but I don't want the SKUs in my report
CASE WHEN RANK() OVER (PARTITION BY SKU USE ME
ORDER BY SUM(Net Sales
) DESC) <= 10 THEN 'Top 10'
ELSE 'Balance'
END
I want to create a group of top 10 and not top 10 and then compare to total for that week but be able to filter for the year and have it adjust.
Answers
-
Hello @andyRowan,
I believe this video from DataCrew can be helpful:
https://youtu.be/-yJXArKUNFo?si=Y63nkca8DMZ_dCS8
If you found this post helpful, please use π‘/π/π/π below! If it solved your problem, don't forget to accept the answer.
0 -
Hello @andyRowan
Can you describe or sketch out briefly in Excel the output you are looking to achieve in Domo with this?
In other words, are you looking to make a table card to do the comparison, or use these metrics in a different type of chart like a line or bar chart?
0 -
So my data is essentially structured like columns A-C. I want to rank by the sum of sales by style. Then I want to show the group that it's in and that group's percent to total.
0 -
I still need the totals from the full dataset so unfortunately this isn't going to work for the use case.
0 -
Hi @andyRowan,
I'm still trying to find a way to make the final calculation but this is what I got until now:
Rank
RANK() OVER (ORDER BY SUM(Sales
) DESC)
Total
SUM(SUM(Sales
) FIXED ())
isTop10
CASE
WHEN RANK() OVER (ORDER BY SUM(Sales
) DESC) < 11 THEN 'Top 10'
ELSE 'Other'
ENDI still can't find a way to calculate the Total of the Top 10. If someone has a better ideaβ¦
If you found this post helpful, please use π‘/π/π/π below! If it solved your problem, don't forget to accept the answer.
0
Categories
- All Categories
- Product Ideas
- 2K Ideas Exchange
- Connect
- 1.3K Connectors
- 308 Workbench
- 7 Cloud Amplifier
- 10 Federated
- Transform
- 661 Datasets
- 117 SQL DataFlows
- 2.2K Magic ETL
- 819 Beast Mode
- Visualize
- 2.6K Charting
- 85 App Studio
- 46 Variables
- Automate
- 193 Apps
- 483 APIs & Domo Developer
- 85 Workflows
- 23 Code Engine
- AI and Machine Learning
- 22 AI Chat
- 3 AI Projects and Models
- 18 Jupyter Workspaces
- Distribute
- 116 Domo Everywhere
- 282 Scheduled Reports
- 11 Software Integrations
- Manage
- 142 Governance & Security
- 9 Domo Community Gallery
- 49 Product Releases
- 13 Domo University
- Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 115 Community Announcements
- 5K Archive