I'm new to Kusto and I'm trying to fetch top 3 accounts with largest sales amount by sales representative by sales region and I'm struggling to get this right. Imagine a table like this:
| Sales_rep | account_id | sales_amount | region |
|---|---|---|---|
| John Smith | 1234 | $100 | North |
| John Smith | 9876 | $400 | East |
| John Smith | 1729 | $1000 | North |
| John Smith | 9387 | $250 | South |
| Maria Klaus | 4567 | $300 | West |
| Maria Klaus | 7890 | $325 | South |
I want to write a KQL script that returns the top 3 accounts by sales_amount per Sales_rep per region. Pretty easy to fetch in SQL by I'm struggling with KQL. Can you please advice how to work this out? Thank you in advance.
you could use the
partitionoperator.