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.
@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:
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].
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'