WeeklyAlteryxTips#45 How to join by the records order

Alteryx

This post is about Join tool’s tips. The Join tool is to merge the two data streams.

It is usually used to join the data by key column, when there is no key column, what should we do?

Join without the key column

Even if there is no key column, there should be some logic for joining. For example, supposing that you need to allocate the resources as follows.

This is task list.

Next is the list that people should be allocated the tasks, which is a resource list.

These data doesn’t have the key columns e.g. ID, so you can not just join.

Here, supposing that you decide the rule to assign each task to a person on the resource list, starting from the top. In this case, you can join the data by the record position of both lists.

Join by the record position

If you want to joint by the record position, the Join tool have a nice option “Join by Record Position”.

When you use this option, you get the joined data bellow.

Of course, the task list which aren’t joined, you can see them at the L anchor.

The workflow for this task is follows.

Can I join a few days data at once?

However, you can only join one day data at once at that way. At another case, you want to join three days data. In this case, you can create three days resource list by the Generate Rows tool and then you can join them. The workflow is as follows.

The Gerenate Rows tool repeat the data three times at each rows for creating three days data.

In this case, you have to sort the data by “Day” using the Sort tool.

In addition, when the case is more complex, you have to use the Iterative macro or Batch macro. If you need to allocate the resource by any districts, you have to use batch macro with grouping function. If you want to know more complex case, you can find Weekly Challenge 415 “Efficient Resource Distribution Using Macros”.

Sample Workflow Download

Contents of the next blog

The next post will be about Join tool tips again.

コメント

Copied title and URL