Alteryx Designer Desktop Discussions

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

Employee Hierarchy match with different table

bharatm
6 - Meteoroid

Hi,

New to ALteryx, I have two tables one has the employee details and the other has hierarchy details as shown below

Table A

EMPLOYEE IDUSERIDFirstNameLastNAme
123456test1IAMTEST
245678Test2HELLOTEST2
345789Test3IamLEGEND
458905Test4TERMINATOR II

Table B

EMPLOYEE IDUSERIDLEVEL1LEVEL2LEVEL3LEVEL4LEVEL5LEVEL 6LEVEL 7LEVEL 8LEVEL 9LEVEL 10
123456test1456789789678678956nullnullnullnullnullnullnull
245678Test2456789789678564789897654678956nullnullnullnull 
345789Test3456789567890nullnullnullnull    
458905Test4456789789678678956563456879654789603342567nullnull 
678956Test5456789789678nullnullnull     
789678Test6456789nullnullnull      

 

how can I get the end table with USERID 's from table1 replace LEVEL 1 which contains EMPLOYEEID and add new column after each LEVEL with name added?

EMPLOYEE IDUSERIDLEVEL 1NAMELEVEL 2NAMELEVEL3NAMELEVEL 4NAMELEVEL 5LEVEL 6LEVEL 7LEVEL 8LEVEL 9LEVEL 10
123456test1test100 test67 yupp3         
245678Test2test100 test67 upoi1 tryme1 iamnew     
10 REPLIES 10
fmvizcaino
17 - Castor
17 - Castor

Hi @bharatm ,

 

It is not clear to me what do you want to do in your output. Would you be able to fill your output table with example values from output2 as well for level1 and name columns?

 

Thanks,

Fernando V.

bharatm
6 - Meteoroid

Hi Fernando,

I want to match each EMPLOYEE ID in Table B(Hierarchy table) starting from LEVEL 1 and match it in Table A and create a new table with the USERID instead of employee ID and get the name added for each employee next to the USERID. If a match is not found in Table A - USER ID should be marked as "UNKNOWN".

 

I have not added all the entries in the sample Table A which are in Hierarchy Table.

EMPLOYEE IDUSERIDLEVEL1LEVEL2LEVEL3LEVEL4LEVEL5LEVEL 6LEVEL 7LEVEL 8LEVEL 9LEVEL 10
123456test1456789789678678956nullnullnullnullnullnullnull
245678Test2456789789678564789897654678956nullnullnullnull 

 

To explain in detail, let say for employee ID "123456" - I want to match LEVEL 1 entry "456789" with Table A and get the USERID and Name for that employee ID and append it to Row 1 (123456) in a new table, it should happen till it gets to null value.

 

EMPLOYEE IDUSER IDLEVEL1NAME1LEVEL2NAME2LEVEL3NAME3LEVEL 4NAME4LEVEL 5NAME5LEVEL6NAME6LEVEL7NAME7LEVEL8NAME8
123456test1test100Iam CEOtest67Iam svpyuop3Iam SDR          
245678test2test100Iam CEOtest67Iam SVPtrespt2I am SDRtryme1IAM DRUNKNOWNUNKNOWN      

 

Hope its clear now?!

 

Thanks,

Bharat

 

 

fmvizcaino
17 - Castor
17 - Castor

Hi @bharatm ,

 

Since you are new to Alteryx, maybe the concepts used to accomplish the result you need is something you haven't seen yet.

I'm using an iterative macro that loops through your data to replace as you need. Inside the macro, there are some instructions showing how I got everything done.

To learn how to configurate an iterative macro, check the video below.

https://community.alteryx.com/t5/Videos/Build-Your-First-Iterative-Macro/td-p/55565

 

I'm sharing with you 2 files and please put both in the same folder.

 

bharatm
6 - Meteoroid

Thanks a ton Fernando. I will go through the tutorial.

fmvizcaino
17 - Castor
17 - Castor

Great @bharatm !!!

 If I achieve your expectations, please mark the answer as correct. 

And keep up the learning!!! 😄

 

Let me know if you have further questions.

Best,

Fernando Vizcaino

danilang
19 - Altair
19 - Altair

Hi @bharatm 

 

Interesting problem that you have, but it doesn't actually need the added complexity of the iterative macro.  You'd use the macro to build the hierarchy table, but since you already have that, you can perform the rest in a standard workflow

 

w.jpg

To give you

 

r.jpg

 

But, take the time to go through the tutorial and build sample macros.  It'll be useful in the future, both for building macros and being able to determine if you actually need to build one. 

 

Dan 

bharatm
6 - Meteoroid

Hi Dan,

The end table should be having corresponding user id's in place of employee id's. In Level 1(n) columns I should have the user id which is captured from Table A.

 

EMPLOYEE IDUSER IDLEVEL1NAME1LEVEL2NAME2LEVEL3NAME3LEVEL 4NAME4LEVEL 5NAME5LEVEL6NAME6LEVEL7NAME7LEVEL8NAME8
123456test1test100Iam CEOtest67Iam svpyuop3Iam SDR          
245678test2test100Iam CEOtest67Iam SVPtrespt2I am SDRtryme1IAM DRUNKNOWNUNKNOWN      

 

Thanks,

Bharat

danilang
19 - Altair
19 - Altair

Here you go @bharatm 

 

r2.jpg

The values in the LEVELx columns are now the user IDs from Table A.  

 

Dan

bharatm
6 - Meteoroid

Thanks alot @danilang . Worked like a charm

Labels