Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Sort Column

jaiiracha
7 - Meteor

Hi I have a column with monthly periods repeating from Jan-21 to Dec-21 (Month-Year) and I would like to sort the rows so that the periods repeat from Jan-21 to Dec-21. For Example, below is my source and target table:

 

Source:

PeriodValue1Value22
21-JanDummy1Dummy6
21-JanDummy3Dummy1
21-JanDummy3Dummy4
21-FebDummy2Dummy7
21-FebDummy1Dummy5
21-FebDummy1Dummy1
21-MarDummy3Dummy3
21-MarDummy5Dummy10
21-MarDummy5Dummy4
21-AprDummy4Dummy3
21-AprDummy6Dummy1
21-AprDummy2Dummy3
21-MayDummy3Dummy3
21-MayDummy1Dummy9
21-MayDummy3Dummy4
21-JunDummy4Dummy1
21-JunDummy5Dummy8
21-JunDummy4Dummy3
21-JulDummy3Dummy5
21-JulDummy3Dummy10
21-JulDummy1Dummy7
21-AugDummy1Dummy10
21-AugDummy4Dummy4
21-AugDummy5Dummy3
21-SepDummy5Dummy1
21-SepDummy3Dummy3
21-SepDummy10Dummy3
21-OctDummy6Dummy9
21-OctDummy4Dummy1
21-OctDummy1Dummy3
21-NovDummy1Dummy8
21-NovDummy3Dummy3
21-NovDummy6Dummy5
21-DecDummy5Dummy10
21-DecDummy1Dummy3
21-DecDummy1Dummy6

 

Target:

 

 

PeriodValue1Value22
21-JanDummy1Dummy6
21-FebDummy3Dummy1
21-MarDummy3Dummy4
21-AprDummy2Dummy7
21-MayDummy1Dummy5
21-JunDummy1Dummy1
21-JulDummy3Dummy3
21-AugDummy5Dummy10
21-SepDummy5Dummy4
21-OctDummy4Dummy3
21-NovDummy6Dummy1
21-DecDummy2Dummy3
21-JanDummy3Dummy3
21-FebDummy1Dummy9
21-MarDummy3Dummy4
21-AprDummy4Dummy1
21-MayDummy5Dummy8
21-JunDummy4Dummy3
21-JulDummy3Dummy5
21-AugDummy3Dummy10
21-SepDummy1Dummy7
21-OctDummy1Dummy10
21-NovDummy4Dummy4
21-DecDummy5Dummy3
21-JanDummy5Dummy1
21-FebDummy3Dummy3
21-MarDummy10Dummy3
21-AprDummy6Dummy9
21-MayDummy4Dummy1
21-JunDummy1Dummy3
21-JulDummy1Dummy8
21-AugDummy3Dummy3
21-SepDummy6Dummy5
21-OctDummy5Dummy10
21-NovDummy1Dummy3
21-DecDummy1Dummy6

 

 

Could anyone pls help with this?

 

Thank you!!

 

 

 

 

4 REPLIES 4
ed_hayter
12 - Quasar

I went with a multi-row formula grouped by period to give each occurance an ID. Parsed the dates so i could sort on ID and date then removed the parse date so its not in the final output.

 

image.png

DataNath
17 - Castor

Hey @jaiiracha, here's one way you could go about it whereby you:

 

1) Use a Multi-Row Formula, grouped by period to create a grouped Index

2) Parse the period into an actual date so it can be sorted properly

3) Sort by the Index (ascending) order, followed by the true date (ascending) order

 

Can't see any obvious sorting of your other [Value1] and [Value22] columns so haven't touched them but happy to take another look if this is important.

FinnCharlton
13 - Pulsar

Hi @jaiiracha , here's how I would approach this. Bear in mind this doesn't take into account any logic from your Dummy fields

 

image.png

jaiiracha
7 - Meteor

All great solutions! thank you all!!

Labels