Free Trial

Alteryx Designer Desktop Discussions

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

Unique Value Help

pbresney
7 - Meteor

I have a dataset with buildings in column A and employees that work in those building in column B. Each person in column B can work in multiple building in column A. I need to ship a package to each individual building, however in order to do that I need to first select an employee in the building. The catch is, each employee can only be used 1 time. I need to find a way in alteryx to ultimately give me each individual building, and only 1 employee from it, and the employee can not be the one that was selected for another building. I am aware that this may not be possible for all, I just need as many as possible, and can manually adjust the remaining that did not have the correct people.

 

Example Data Below:

BuildingEmployee
A1
A3
B5
B1
B2
C7
D9
E2
E3
E1
F4
F6
F3
F8
G9
G5
H5
I3
I1
3 REPLIES 3
Carolyn
12 - Quasar
12 - Quasar

Obviously this isn't your real data, but .... .for Building H, the only employee there is #5. For Building D, the only employee there is #9. For Building G, the only employees there are #9 & #5. The problem is that if you set H-5 and D-9, there are no options for G

 

If this were your real data, is it expected to have more employees (who can receive mail) at each building?

pbresney
7 - Meteor

The true data contains thousands of building and thousands of employees. There will be some buildings that are not able to be shipped to because there is not an available employee since the employee may be being used for a different office. This is fine, as I need as many as possible and will deal with those without a viable employee later.

Yoshiro_Fujimori
15 - Aurora
15 - Aurora

Hi @pbresney ,

 

Please let me know if the attached workflow works.

The idea is use Iterative Macro which follows the steps below:

Step 1. Pick the 1st line of the table and output the [Building]-[Employee] pair.

Step 2. Filter out the [Building] and the [Employee] from the rest of the table.

Step 3. Input the output of Step 2 as the next Iteration.

 

Workflow

workflow.png

Iterative Macro

macro.png

Input

BuildingEmployee
A1
A3
B5
B1
B2
C7
D9
E2
E3
E1
F4
F6
F3
F8
G9
G5
H5
I3
I1

 

Output

BuildingEmployee
A1
B2
C7
D9
E3
F4
G5
Labels
Top Solution Authors