Hi guys,
I have a database of online orders, i need to flag id_clients that have the same product ordered in less than 2 days a part.
Input:
| Client_ID | Product | Order_date |
1 | apple | 29/04/2024 |
| 1 | banana | 25/04/2024 |
| 1 | apple | 27/04/2024 |
Expected output:
| Client_ID | Product | Order_date | Flag |
1 | apple | 29/04/2024 | 1 |
| 1 | banana | 25/04/2024 | 0 |
| 1 | apple | 27/04/2024 | 0 |
How can i make this flag column?