Forum Discussion
Elisa112
2 years agoHelper V
Rank Customer Appointments by type
Hi Experts
I have been trying this out for several days, I need to rank a table of appointment by type. Each customer has several appointments of different type and I need to rank within each type for each customer. Here is an example of my data
| UserID | MeetingID Meeting Type | Meeting Date | |
| 1 | 200 | PDP | 01/04/2024 |
| 1 | 201 | Assess | 01/03/2024 |
| 1 | 199 | PDP | 31/03/2024 |
| 1 | 198 | PDP | 25/02/2024 |
| 1 | 189 | PDP | 22/01/2024 |
| 1 | 135 | Assess | 01/02/2024 |
| 2 | 300 | PDP | 01/04/2024 |
| 2 | 301 | Assess | 01/03/2024 |
| 2 | 399 | PDP | 25/03/2024 |
| 2 | 395 | PDP | 24/02/2024 |
| 2 | 375 | Assess | 15/01/2024 |
so for each customer per meeting type, I need the output to look like this below:
| UserID | MeetingID Meeting Type | Meeting Date | Rank | |
| 1 | 200 | PDP | 01/04/2024 | 4 |
| 1 | 201 | Assess | 01/03/2024 | 2 |
| 1 | 199 | PDP | 31/03/2024 | 3 |
| 1 | 198 | PDP | 25/02/2024 | 2 |
| 1 | 189 | PDP | 22/01/2024 | 1 |
| 1 | 135 | Assess | 01/02/2024 | 1 |
| 2 | 300 | PDP | 01/04/2024 | 3 |
| 2 | 301 | Assess | 01/03/2024 | 2 |
| 2 | 399 | PDP | 25/03/2024 | 2 |
| 2 | 395 | PDP | 24/02/2024 | 1 |
| 2 | 375 | Assess | 15/01/2024 | 1 |
Thank you in advance
Elisa112 , Create a new column
Rank = Rankx( filter(Table, [UserID] = earlier([UserID]) && [Meeting Type] = earlier([Meeting Type])), [Meeting Date],,asc,dense)
2 Replies
- amitchandakSuper User
Elisa112 , Create a new column
Rank = Rankx( filter(Table, [UserID] = earlier([UserID]) && [Meeting Type] = earlier([Meeting Type])), [Meeting Date],,asc,dense)
- Elisa112Helper V