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
- 1.9K Product Ideas
- 1.9K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 307 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3K Transform
- 112 SQL DataFlows
- 649 Datasets
- 2.2K Magic ETL
- 4K Visualize
- 2.5K Charting
- 790 Beast Mode
- 78 App Studio
- 43 Variables
- 746 Automate
- 187 Apps
- 475 APIs & Domo Developer
- 68 Workflows
- 16 DomoAI
- 40 Predict
- 17 Jupyter Workspaces
- 23 R & Python Tiles
- 406 Distribute
- 117 Domo Everywhere
- 279 Scheduled Reports
- 10 Software Integrations
- 139 Manage
- 136 Governance & Security
- 8 Domo Community Gallery
- 47 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 113 Community Announcements
- 4.8K Archive