In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

Convert Number Month to String Month

NBPSE
8 - Asteroid

My excel input file is a number as shown below. How can I use Alteryx to output this as 'July'

 

Date.JPG

11 REPLIES 11
Raj
16 - Nebula

@NBPSE 
find the workflow attached Mark done if solved.

datetimeformat(DateTimeParse([Date], "%m/%d/%Y"),"%B")

NBPSE
8 - Asteroid

I tried this formula and it is giving me a Null output. Does something need to be changed?

output.JPG

ChrisTX
16 - Nebula
16 - Nebula

After your Excel data is imported to Alteryx, what is the data type for field [Document Date] ?

 

I'm guessing it may be a Date.

 

Try only the DateTimeFormat function:

   DateTimeFormat([Document Date],"%B")

 

See the list of DateTime functions here:  https://help.alteryx.com/current/en/designer/functions/datetime-functions.html##

 

 

Chris

NBPSE
8 - Asteroid

Yes it is Date, thank you, this worked!

NBPSE
8 - Asteroid

I am also formatting a date, but it is outputting as 07/01/2024. How can I have the output read 7/1/2024?

ChrisTX
16 - Nebula
16 - Nebula

please explain "it is outputting as 07/01/2024"

 

what is "it"?  What is the data type you are starting with?  Date?

 

Use the function DateTimeFormat.  review the link I sent for DateTime functions, and check out the section for Specifiers

 

Chris

 

NBPSE
8 - Asteroid

This is the output I am getting from using the DateTimeFormat formula. I see your specifiers and have tried a few combinations of %e to replace the leading zero with a space, and intend to cleanse the data after to remove any leading zeros. Currently my combinations of using the %e are not updating the date output as I would expect. What formula would remove the leading zeros in formatting this date (for month and day)?

New.JPG

ChrisTX
16 - Nebula
16 - Nebula

Sometimes Alteryx makes it hard.  There isn't a specifier to convert a 0 to a space, in a month value.

 

Combine a few functions:

 

ReplaceChar(TrimLeft(DateTimeFormat([f1],"%m/%e/%Y"),"0"), " ", "")

 

Screenshot 2024-07-18 131114.png

 

Chris

Labels
Top Solution Authors