Alteryx Designer Desktop Discussions

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

Select sheet from excel based on condition

Sshasnk
8 - Asteroid

I have a 2 excel workbook one workbook has some record and the second one has multiple sheets. Based on some conditions I have to select the sheet from the second workbook. Example below

 

2nd workbook has 2 sheets -> Apple and mango

 

1st workbook has records ->

 

Fruit
Apple
mango

 

Condition :

So 1st row which has Apple So I have to open the apple sheet and do a join and if it has mango I have to open sheet name mango and do a join.

6 REPLIES 6
atcodedog05
22 - Nova
22 - Nova

Hi @Sshasnk ,

 

Great scenario. We would need a batch macro for this.

 

Can you provide some sample files and expected output so that we can build a workflow. 

Emil_Kos
17 - Castor
17 - Castor

Hi @Sshasnk,

 

I have never build a solution like this but if you will used dynamic input tool you will get list of sheets. Afterwards you can create a filter that will work based on the IF condition. If certain conditions are meet you will load one sheet if they will not be use another one. 

 

For reference how to get list of sheet names:

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Dynamic-Input-List-of-Excel-Sheet-Name...

 

 

Emil_Kos
17 - Castor
17 - Castor

Hi @Sshasnk,

 

Actually I have an alternative scenario. What if you will just use input tool with a sheet name as an output. Do this for two files and then perform union action on them.

 

You will have 1 data set with 2 sheets inside and you can join both data sets. After they will be joined you can remove the data that you don't need based on the criteria. 

 

Hope this helps. 

atcodedog05
22 - Nova
22 - Nova

Great and Interesting approaches @Emil_Kos  😀👍 

atcodedog05
22 - Nova
22 - Nova

Hi @Emil_Kos ,

 

I think dynamic tool is a better choice. Since we need to read multiple sheets.

grazitti_sapna
17 - Castor

Hi @Sshasnk , I have prepared a mock workflow, can you please have a look and let us know if it works for you?

 

grazitti_sapna_0-1601883708547.png

 

What I have done is I read all the sheets from another source and filtered it as per requirement.

 

Thanks.

Sapna Gupta
Labels
Top Solution Authors