The question is not entirely clear. However, I think what you're asking is how to rank all users' purchases by day:
history_date | user_id | DailyTotal | totalRank |
---|---|---|---|
2022-01-01 | 2 | 1.50 | 1 |
2022-01-01 | 1 | 0.75 | 2 |
2022-01-01 | 3 | 0.65 | 3 |
2022-01-02 | 3 | 3.65 | 1 |
2022-01-02 | 1 | 2.90 | 2 |
2022-01-02 | 2 | 0.75 | 3 |