Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

How to compare dates

VitorCM
5 - Atom

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_IDProductOrder_date

1

apple29/04/2024
1banana25/04/2024
1apple27/04/2024

 

 

Expected output: 

 

Client_IDProductOrder_dateFlag

1

apple29/04/2024

1

1banana25/04/20240
1apple27/04/20240

 

How can i make this flag column?

3 REPLIES 3
adamweaver39
9 - Comet

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!

dtdiff.jpg

binuacs
21 - Polaris

@VitorCM One way of doing this

image.png

VitorCM
5 - Atom

Amazing, works! Thanks for the solution!

Labels
Top Solution Authors