SQLDAXExcelPython
Leaderboard
Window functionsMedium20 points

Rank products in each category

For each product that has sales, return Category, ProductName, total Amount, and its rank within the category, where rank 1 has the highest revenue.

Show solutionLifetime

Runs in your browser with DuckDB, whose SQL is close to PostgreSQL. Nothing you type is sent to a server unless you save a score.

SQLselect text to run only that part
Loading editor…

Press Ctrl+Enter or Run to see the result here.