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

@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.

binuacs
20 - Arcturus

@Mohini79 different approaches to achieve your result

 

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

 

binuacs_0-1680761720929.png

 

 

Yoshiro_Fujimori
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