Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Apply Formula on dates and update the new column

Lakshmikanth_2021
8 - Asteroid

I need apply the date formula on column 'Created On' on input file and get the desired 'output' in Alteryx. 

 

Formula: If the 'created on' is in the last 7 days, add a new column and update the rows as Yes. else keep it blank.

2 REPLIES 2
grazitti_sapna
17 - Castor

Hi @Lakshmikanth_2021, try this.

 

if DateTimeDiff(DateTimeToday(),[Created On],'days')>=0 and
DateTimeDiff(DateTimeToday(),[Created On],'days')<=7 then "Yes" else Null() endif

 

grazitti_sapna_0-1656994173047.png

 

I hope this helps!

 

Thanks!

 

Sapna Gupta
binuacs
20 - Arcturus

@Lakshmikanth_2021 similar to @grazitti_sapna solution

IIF(DateTimeDiff(DateTimeToday(),[Created On],'days') <= 7 AND DateTimeDiff(DateTimeToday(),[Created On],'days') >= 0, 'Yes', Null())

binuacs_0-1656996702322.png

 

Labels