Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

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

Change Date format

srk0609
8 - Asteroid

I have attached a file with i/p and expected o/p( in yellow background). If there is HBT in reference then the date in Reference is o/p else we have to add 1 month to date to get o/p can anyone help? I also attached excel file. Thank you.

8 REPLIES 8
binuacs
21 - Polaris

@srk0609 One way of doing this

 

binuacs_0-1652766795524.png

 

flying008
15 - Aurora

Hi,@srk0609 

 

FYI. ( In your want output , the "22" is year or day ? )

 

IIF(Contains([Reference], "HBT"), DateTimeAdd([Date],ToNumber(REGEX_Replace([Reference], "[\D]", ""))-1,"day"), DateTimeAdd(DateTimeAdd([Date],ToNumber(REGEX_Replace([Reference], "[\D]", ""))-1,"day"),1,"month"))

 

 

录制_2022_05_17_14_03_56_454.gif

grazitti_sapna
17 - Castor

@srk0609, another way to approach this problem.

 

grazitti_sapna_0-1652768410841.png

 

 

Thanks!

Sapna Gupta
srk0609
8 - Asteroid

Hi @flying 008,

 

The 22 is year. Thank you for the help. I will review the wf you provided.

srk0609
8 - Asteroid

Hi,

 

In my alteryx designer I have a column with value 31-MAY-22 and I want to convert it to date 2022-05-31 so that I cn use your formula. Can you please help? Thank you

DataNath
17 - Castor
17 - Castor

@srk0609 can use:

 

DateTimeParse([Date],'%d-%b-%y')

 

DataNath_0-1652907117355.png

 

srk0609
8 - Asteroid

Thank you for your help

srk0609
8 - Asteroid
Labels