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

How to convert Date into month =IF(A2>0,TEXT(A2,"YYYY")&"-"&TEXT(A2,"MM"),0)

Kinetic_analytics
11 - Bolide

Hello Community:

How to convert Excel formula into Alteryx formula?

 

=IF(A2>0,TEXT(A2,"YYYY")&"-"&TEXT(A2,"MM"),0)

 

Appreciate your response.

 

Thanks

 

2 REPLIES 2
Kenda
16 - Nebula
16 - Nebula

Hi @Kinetic_analytics 

 

If you read your date field into Alteryx and it already recognizes it as a date ("YYYY-MM-DD"), you should be able to create a new string field with a formula tool with this expression: 

datetimeformat([Date], "%Y-%m")

 

 

On the other hand, if you read your field into Alteryx and it still looks like "MM/DD/YYYY" then try this expression to create a string field using a formula tool: 

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

 

 

If you want more details on date/time formatting in Alteryx, see this article: https://help.alteryx.com/20213/designer/datetime-functions  

Kinetic_analytics
11 - Bolide

Thank you.

Labels
Top Solution Authors