Hi all,
I have taken a large set of data and extracted out the key information I require, I have transposed a MMM-YY value into just a month and then used cross tab to change these into headers for each month (see below example). The output of the headers are in alphabetical order whereas I want them to show in chronological month order i.e. Jan, Feb, Mar.
I've searched for a solution but nothing seems to cover this, apologies if I'm being stupid, I'm just starting to get to grips with Alteryx.
You will need to add in the numeric month beforehand using a Formula of sorts, then after you Crosstab you can remove the numbers with a Dynamic Rename!
@AlexSimmons similar to @alexnajm suggestion, but here i converted the given MMM-YY to days and converted it back to MMM-YY in the heading using dynamic rename tool
Thanks both for the responses, @binuacs when I opened your database it had a parse error, from what I can establish because there is a mixture of string and a date value? (could be wrong) but still provides the correct output, however when you use ToDate it classes the output as an integer rather than text (string) so it returns a null value. This subsequently causes the DynamicRename to fail for the same reason, I've run a similar logic with my own data and get the same outcome.
Appreciate your thoughts and guidance, thanks.
Alex.
@AlexSimmons can you provide some sample data similar to your input which you were facing parse error?
Dynamic Rename-> select all fields:
if !isnull(datetimeparse([_CurrentField_],'%B')) then trimleft(datetimeformat(datetimeparse([_CurrentField_],'%B'),'%m'),'0') else [_CurrentField_] endif
this asusmes that your months are in full month name (August/September) --- if they are like "Aug","Sep" --- use %b
and my assumption is that February is February the following year -> so you want it after December. I'm not resorting your column names here. because I do not want to make an assumption about your compare logic.