Alteryx Designer Desktop Discussions

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

vlookup with dynamic field

mingjue
5 - Atom

Hi I am trying to recreate the Excel vlookup function in Alteryx, but I can't figure out. Need some help. Thanks.

 

Here is vlookup I use in Excel : =IF(A2="Jan",VLOOKUP(B2,[Jan]Jan!$A:$D,C2+1,0),IF(A2="Feb",VLOOKUP(B2,[Feb]Feb!$A:$D,C2+1,0)))

 

Here are 3 sample excels files :

Jan and Feb files have detail sales information for each ID each metric ID.

 I would like to put Jan and Feb information into summary files.

 

Summary  
MonthIDMetric IDSales
JanAAA110
JanAAA220
JanAAA330
JanBBB120
JanBBB230
JanBBB340
FebAAA1100
FebAAA2200
FebAAA3300
FebBBB1500
FebBBB2600
FebBBB3700

 

Jan File

ID123
AAA102030
BBB203040

 

Feb file 

 

ID123
AAA100200300
BBB500600700
6 REPLIES 6
Emil_Kos
17 - Castor
17 - Castor

Hi @mingjue,


I have created a solution for you:

 

Emil_Kos_0-1612019991104.png

Keep in mind that you will need to adjust this formula to make it work fo you.

 

Emil_Kos_1-1612020006085.png

 

Please mark my post as a solution if this was helpful!

mingjue
5 - Atom

Thanks @Emil_Kos 

 

I may mislead you from my last post. 

 

Actually I would like to get sales number from Jan and Feb files and put into summary file. 

 

In the summary excel file, I used the vlookup formula as below. But I can't figure out how to do it in Alteryx. (I just began to use Alteryx)

 

MonthIDMetric IDSales
JanAAA1=IF(A2="Jan",VLOOKUP(B2,[Jan]Jan!$A:$D,C2+1,0),IF(A2="Feb",VLOOKUP(B2,[Feb]Feb!$A:$D,C2+1,0)))
JanAAA2 
JanAAA3 
JanBBB1 
JanBBB2 
JanBBB3 
FebAAA1 
FebAAA2 
FebAAA3 
FebBBB1 
FebBBB2 
FebBBB3 
Emil_Kos
17 - Castor
17 - Castor

Hi @mingjue,

 

can you provide an expected output?

 

It looks like you are using this tab to fetch the data from Jan tab if it is January data or Feb tab if this is the data from February.

 

In Alteryx there is 2 vlookups tool. One is called the join tool and the second one is to find and replace. 

 

If you will provide us with more details we will definitely help you. 

Emil_Kos
17 - Castor
17 - Castor

Hi @mingjue,

 

Actually, I was thinking about your requirement. I think I know what you need:

 

Emil_Kos_0-1612048986627.png

The output:

 

Emil_Kos_1-1612049002027.png

 

mingjue
5 - Atom

Great, @Emil_Kos    It works. Thank you for quick response. 

 

 I am wondering any other solution which I don't need to combine Jan and Feb files and transpose combined file.  

 

 

Emil_Kos
17 - Castor
17 - Castor

Hi @mingjue,

 

Can you give me more details about why you are searching for alternative solutions? 

 

If all those files are in the one folder you can use wildcard in input tool to load all of them at once but I am not sure about removing transpose tool. 

Labels
Top Solution Authors