This article is part of the Tool Mastery Series, a compilation of Knowledge Base contributions to introduce diverse working examples for Designer Tools. Here we’ll delve into uses of the Arrange Tool on our way to mastering the Alteryx Designer:
The Arrange Tool allows you to manually transpose and rearrange your data. It can be used to combine multiple fields into a single target field. However, the interface of the Arrange Tool a little more confusing than other tools in the Transform Group.
To explain this tool’s interface, I am going to walk through a basic example of its use.
My input data looks like this:
The data are line segments, where x1, y1 are coordinates for the start point and x2, y2 are coordinates for the endpoint. My goal in doing this data manipulation is to combine my x1 and x2 fields into a single X field and my y1 and y2 fields into a single Y field.
The Key Fields selection window works the same way as in the Transpose Tool. Fields that you select in this window will be propagated directly to your output, and act a “key” for your original rows of data. This means that if you merge multiple fields, your key fields will be duplicated for each new row.
I have selected RecordID as a key field, so I can keep track of which record each of these coordinate pairs belong to. Your selected Key Fields will be preserved through the tool, the data being duplicated every time a row is repeated due to the fields you combine.
To add your output columns, you select the column drop down option below the Key Fields interface, and select add. The resulting interface will let you set up your first output column.
I set up my output X column by typing in the Column Header name “X’ and selecting my two x fields. I leave the description fields to the defaults, so that I can modify them manually later. If I were to select None from Fill in Description Column, no description column would be created. If I were to select Take from Fields names under Description Mode, the field names of the selected fields would automatically populate the created description fields.
After hitting OK, the Output Fields window now looks like this:
I repeat the process with my y fields to create a Y column. If I wanted to change any of the data going into each of the columns (say I accidently selected an x field in the y column) I can change the fields in each of the columns by selecting the drop down option I want to change.
Now I can also type in information into the description fields. This is not required (you can delete the description column, or not even create it if you don’t want to), but I would like to keep track of which points are a starting point and which are end points, so I type in 1 for the first row and 2 for the second. For my purposes, it was important to make sure x1 lined up with y1, and x2 lined up with y2. It made sure that the x,y pairs were preserved in rows. If I had put x1 with y2, I would have ended up with entirely new coordinate pairs.
Now my arrange tool is all set up! After running, the output looks like this:
Easier than it looks, right? This is a simple example, but the exact same process will apply to more complex uses of the Arrange Tool.
Here are a few closing notes:
Fields selected as Key Fields are Preserved.
The order you select fields in the output fields window in each field is the order they will be transposed in for each row.
The Description Field is optional, but it helps keep track of your data and can be generated automatically using the Description Mode Option in the Add Column window.
There you have it! Happy Arranging!
By now, you should have expert-level proficiency with the Arrange Tool! If you can think of a use case we left out, feel free to use the comments section below! Consider yourself a Tool Master already? Let us know firstname.lastname@example.org you’d like your creative tool uses to be featured in the Tool Mastery Series.
Stay tuned with our latest posts everyTool Tuesdayby followingAlteryxon Twitter! If you want to master all the Designer tools, considersubscribingfor email notifications.