Free Trial

General Discussions

Discuss any topics that are not product-specific here.

How to extract month from the date

Sanjana_HS
8 - Asteroid

Hi,
This is my date 08-11-2023 and in new coloumn i want Month as november with year. how to achieve this is alteryx.

Few more examples:
1. 09.23.2023- New coloumn "September 2023"
2. 07.23.2023- New coloumn "July 2023 "

Thank you in advance

1 REPLY 1
Rana_Kareem
9 - Comet

Hi @Sanjana_HS ..

 

First of all, you have to distinguish between day and month. What is the first digit, is it day or month?

Then, you need to know what type of punctuation is used between date numbers, is it hyphen or slash or dot.

Accordingly, you write the correct format.

 

If the date is in this format (08-11-2023) separated by hyphen and the first digit is day, then, the expression will be:

DateTimeFormat(DateTimeParse([Date Field], "%d-%m-%Y"), "%B %Y")

 

 

Or if the date is in this format (09.23.2023) separated by dot and the first digit is month, then the expression will be:

DateTimeFormat(DateTimeParse([Date Field], "%m.%d.%Y"), "%B %Y")

 

 

On this page, you can learn more about DateTime Functions and the right way to use it.

 

 

If my solution helped you, please accept it as a solution.

Labels
Top Solution Authors