ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more 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

binu_acs
21 - Polaris

@VitorCM One way of doing this

image.png

VitorCM
5 - Atom

Amazing, works! Thanks for the solution!

Labels
Top Solution Authors