Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Need Help to Find Formula

Kpascal97
5 - Atom

Can you please help me finding the right formula for these two belows:

 

1-) Create a new column named “YearError”. If the Date is >1/3/2025, then YearError=”Invalid”.

 

2-) In the Date column, there is an observation of 2055. This is an error. Correct it to 2025. (Hint:
use Fomula)

2 REPLIES 2
gawa
16 - Nebula
16 - Nebula

hi @Kpascal97 

At first, your question seems the extract from some learning contents.(Because in question 2, it says 'Hint')

Please make sure that sharing those contents here does not violate terms & condition you should have agreed.

 

Anyway, for question 1, you can simply use IF THEN ELSE conditional statements.

For question 2, Replace function would help.

 

Good luck!

Manoj_k
9 - Comet

Formula to create "YearError" column:

CASE WHEN [Date] > ToDate('01/03/2025') THEN 'Invalid' ELSE NULL ENDif

 

Formula to correct date:

IF Year([Date]) > 2050 THEN ToDate('01/01/2025') ELSE [Date] ENDif

Labels
Top Solution Authors