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?
Solved! Go to Solution.
Hey @VitorCM ! I think you could use the DateTimeDiff formula to calculate date differences, grouped by product, and flag when it meets you're criteria through a second formula tool (i.e. difference <= 2 is "Flag") -- just make sure your date field reads as a date before running the calculation!
@VitorCM One way of doing this
Amazing, works! Thanks for the solution!