community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Community v19.6

Looks aren't everything... But the latest Community refresh looks darn good!

Learn More

Excel Custom Sort in Alteryx

Highlighted
Atom

Hi All 

 

I have come from an excel background, and trying to do a Custom Sort (see attachment) inside Alteryx. 

Can someone please show or even attach a quick sample file of how i would go around doing this please?

 

Shrik

Meteoroid

Hi @Shrik ,

 

It looks like for HoodieStyle and Colour you would just select Ascending under Order in the Sort Tool. For Size, you could use the Formula Tool to create a new field, say SizeSort with the following formula:

 

IF [Size]= "XXS" THEN "1 XXS"
ELSEIF [Size]= "XS" THEN "2 XS"
ELSEIF [Size]= "S" THEN "3 S"
ELSEIF [Size]= "M" THEN "4 M"
ELSEIF [Size]= "L" THEN "5 L"
ELSEIF [Size]= "XL" THEN "6 XL"
ELSEIF [Size]= "XXL" THEN "7 XXL"
ELSEIF [Size]= "XXXL" THEN "8 XXXL"
ELSE "9 XXXXXL" ENDIF

 

Then just add SizeSort to the Sort Tool after you've added HoodieStyle and Colour, and select Ascending under Order.

Aurora

Hi @Shrik 

 

While @MPolin's method will certainly work, I think that using lookups for the sort orders will be easier to maintain and will allow for custom sorting options.  For example, you may want to sort the colours by base colour, so that Royal Blue, Navy Blue and Sky Blue all appear together.  It will be easier to change the lookup list than to change the IF statement.  You can even have the sort order lists maintained outside of the workflow by a designer and read in at run time.

 

WF.png

This workflow uses a look up table for all 3 options.  The inventory file is a list of all possible combinations.  The Random sample tool selects an inventory made up of 75% of the possible combinations.  The look up files are then joined to inventory in turn and the final list is sorted and cleaned, resulting in 

 

Results.png

 

Dan

Atom

Thanks ! 

Helpful...

Labels