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

Simplifying the Formula to create a new column called "New Complete Date."

Ben_D_S
6 - Meteoroid

1. The query first checks if the first 4 characters of the field "FinalizeDate" are equal to "2020".
2. If the condition in step 1 is true, then it converts the "FinalizeDate" to a date format using the DateTimeParse function and then formats it to display only the month and day in the format "MM/DD".
3. If the condition in step 1 is false, the query then checks if the first 2 characters of the "FinalizeDate" are less than "14".
4. If the condition in step 3 is true, it extracts the first 5 characters of the "FinalizeDate".
5. If both conditions in step 1 and step 3 are false, the query simply formats the "FinalizeDate" to display only the month and day in the format "MM/DD".
6. The final result will be based on the conditions met in steps 1, 3, and 5.

 

I think this can be done in fewer steps. Thoughts? 

6 REPLIES 6
binuacs
21 - Polaris

@Ben_D_S What is the format of the field FinalizeDate? Can you provide a sample data 

binuacs
21 - Polaris

@Ben_D_S Assuming the date format is like YYYYMMDD . in the third condition are you checking the first 2 characters or 3-4 characters ?

image.png

Ben_D_S
6 - Meteoroid

2 characters 

binuacs
21 - Polaris

I mean first two positions or 3rd and 4th position? also what is your input date format?

Ben_D_S
6 - Meteoroid
YYYY-MM-DD HH:mm:ss. And first two positions 
binuacs
21 - Polaris

updated workflow attached

image.png

Labels