Get Top 5 category values for each date from category
I have a column "category" which has more than 10 categories for each date. I would want to see only the Top 5 category for each date. Can I get a beast mode or a work around for the same.
I have attached an image for reference.
Best Answer
-
You can do this by using the rank window function in a beast mode and then adding it to the filter to filter where rank is less than or equal to 5.
RANK() OVER (PARTITION BY WEEKOFYEAR(`date`) ORDER BY SUM(`metricfield`) DESC)
If you don't have window functions for beast modes turned on in your instance, you will need to have your CSM enable it.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.1
Answers
-
You can do this by using the rank window function in a beast mode and then adding it to the filter to filter where rank is less than or equal to 5.
RANK() OVER (PARTITION BY WEEKOFYEAR(`date`) ORDER BY SUM(`metricfield`) DESC)
If you don't have window functions for beast modes turned on in your instance, you will need to have your CSM enable it.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.1
Categories
- All Categories
- 1.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 295 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.8K Transform
- 97 SQL DataFlows
- 608 Datasets
- 2.1K Magic ETL
- 3.8K Visualize
- 2.4K Charting
- 710 Beast Mode
- 49 App Studio
- 39 Variables
- 667 Automate
- 170 Apps
- 446 APIs & Domo Developer
- 44 Workflows
- 7 DomoAI
- 33 Predict
- 13 Jupyter Workspaces
- 20 R & Python Tiles
- 391 Distribute
- 111 Domo Everywhere
- 274 Scheduled Reports
- 6 Software Integrations
- 115 Manage
- 112 Governance & Security
- Domo Community Gallery
- 31 Product Releases
- 9 Domo University
- 5.3K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 103 Community Announcements
- 4.8K Archive