Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Converting a string format to a Month Format

Arkouda
8 - Asteroid

HI All

 

I'm sure this is easy to do, but i have tried on my end

 

How do you convert the effective date values to present it by month instead of a string format? 

 

i.e. 12/31/2019 = December 

1/31/2020 = January 

2/29/2020 = February 

 

Arkouda_0-1587073337835.png

 

3 REPLIES 3
grossal
15 - Aurora
15 - Aurora

Hi @Arkouda,

 

you can use the Formula tool for this.

 

DateTimeFormat([Column], '%B')

 

Minimal Sample attached.

 

Best

Alex

 

CharlieS
17 - Castor
17 - Castor

Hi @Arkouda 

 

There are two steps to this process that we can combine into one formula you'll see below (and in the attached example).

 

Step 1 - Convert the string "12/31/2019" into the official datetime format that Alteryx uses (ISO 8601: which looks like YYYY-MM-DD). In the DateTimeParse( expression below, we'll use the Alteryx references to identify the positions of the necessary pieces of information in the input string. Here's a link to the documentation on these formula references: https://help.alteryx.com/10.1/Reference/DateTimeFunctions.htm

 

DateTimeParse("12/31/2019","%m/%d/%Y")

 

This will return the date in the standard format: "2019-12-31". Now that we have this date values, we can format that into the desired, month, output. We'll do this by wrapping a DateTimeFormat( function around the previous step:

 

DateTimeFormat( DateTimeParse("12/31/2019","%m/%d/%Y"), "%B")

 

This will return the values of "December". To do this dynamically, you can replace the "12/31/201" in the expression with a field name. 

 

20200416-MonthLabelChart.PNG

Arkouda
8 - Asteroid

thank you it worked 

Labels
Top Solution Authors