In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Help Required in formula

Mohini79
7 - Meteor

Dear All,

 

I have column with date as ( 01-09-2022 ).

I want formula to extract only month and year in format mmm-yyyy.

 

Please help. 

Thanks in advance

3 REPLIES 3
Yoshiro_Fujimori
15 - Aurora
15 - Aurora

@Mohini79 ,

I would convert the date to Date type,

and then convert it to my favorite format.

Workflow

Yoshiro_Fujimori_1-1680760759703.png

 

Formula

DateFormat = DateTimeParse([Date],"%d-%M-%Y")

mmm-yyyy = DateTimeFormat([DateFormat],"%b-%Y")

Output

Yoshiro_Fujimori_0-1680760733990.png

 

Please see the attached workflow for detail.

binu_acs
21 - Polaris

@Mohini79 different approaches to achieve your result

 

DatetimeFormat(DateTimeParse([Date],’%d-%m-%Y),’%B-%Y’)

 

binuacs_0-1680761720929.png

 

 

Yoshiro_Fujimori
15 - Aurora
15 - Aurora

Sorry I found a mistake in my formula.

Wrong:   DateTimeParse([Date],"%d-%M-%Y")

Correct: DateTimeParse([Date],"%d-%m-%Y")

 

Correct output:

Yoshiro_Fujimori_0-1680767214202.png

 

The formula is case-sensitive!!

Labels
Top Solution Authors