Alteryx Designer Desktop Discussions

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

Date importing as VString

Karl_Spratt
8 - Asteroid

Hi Community,

Need help please I have to create pivot data in Monthly buckets for customer orders by request date & Order entry date. 

both columns of data are importing as vstring fields, I tried changing in the select tool and this doesn't work 

 

Example of the data would be 19/02/2021 I need this to come out in the MMM-YY format so I can pivot that as Feb-21 Demand.

 

Can anyone please advise the format / formula to do this please.

TIA,

Karl. 

3 REPLIES 3
DataNath
17 - Castor

@Karl_Spratt Alteryx works with dates in a YYYY-MM-DD format and so if you ever have a date field that follows a different pattern, you first need to parse this. You can either use the DateTime tool or DateTimeParse() function in one of the formula tools. Once you have the date in a correct format, you can then change it back into a string in whichever format you like.

 

Here you're first of all telling Alteryx that the incoming date is in a dd/mm/yyyy format, which is what the %d/%m/%Y part of the function signifies. After parsing it, the %b-%y represents the conversion into abbreviated month - 2 digit year:

 

DataNath_0-1664355139494.png

 

If you're applying this to 2 date fields at once, it's worth using a Multi-Field Formula tool and ticking the 2 fields. Then in the expression itself, you'd just use [CurrentField] where I currently have [Input Date].

 

DataNath_0-1664355791927.png

Christina_H
14 - Magnetar

Using the DateTime functions, you need to convert to dates and then format appropriately.  DateTime Functions | Alteryx Help

DateTimeFormat(DateTimeParse([Date],'%d/%m/%Y'),'%b-%y')+' Demand'

Christina_H_0-1664355418251.png

 

binuacs
20 - Arcturus

@Karl_Spratt One way of dong this

 

binuacs_0-1664355618460.png

 

Labels