cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx Knowledge Base

Definitive answers from Designer experts.
Online Help Survey

Help shape the future of Alteryx Technical Documentation by sharing your feedback!

LEARN MORE
Announcement | Looking to expand your Alteryx skillset?! Check out the latest set of interactive lessons in Alteryx Academy: Creating Analytic Apps

Tool Mastery | Arrange

Alteryx
Alteryx
Arrange.png

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.

 

2017-11-02_11-49-32.png

 

To explain this tool’s interface, I am going to walk through a basic example of its use.

 

2017-11-02_11-51-16.png

My input data looks like this:

  

2017-11-01_12-02-10.png

  

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.

 

2017-11-01_12-03-47.png

  

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.

 

2017-11-01_12-04-41.png

 

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.

 

2017-11-01_12-08-04.png

 

 After hitting OK, the Output Fields window now looks like this:

 

2017-11-01_12-08-54.png

 

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.

 

2017-11-01_12-09-41.png

 

Now my arrange tool is all set up! After running, the output looks like this:

 

2017-11-01_12-10-46.png

 

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 at community@alteryx.com if you’d like your creative tool uses to be featured in the Tool Mastery Series.

 

Stay tuned with our latest posts every Tool Tuesday by following Alteryx on Twitter! If you want to master all the Designer tools, consider subscribing for email notifications.