So I have a dataset for each account and I have to rank them based on the amount
Input:
| account | amount |
| 1234 | 12 |
| 1234 | 15 |
| 1234 | 45 |
| 1234 | 65 |
| 12 | 12 |
| 12 | 45 |
| 12 | 4 |
Rules:
1. Highest amount will get ranked as 1 for that account
2. Second highest will get ranked as 2 for that account
3. Everting after the second highest should get ranked as 3
4. Please, remember for rank 3 we don't know how many rows will come
Output:
| account | amount | Rank |
| 1234 | 12 | 3 |
| 1234 | 15 | 3 |
| 1234 | 45 | 2 |
| 1234 | 65 | 1 |
| 12 | 12 | 2 |
| 12 | 45 | 1 |
| 12 | 4 | 3 |