Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

MACRO - Any Suggestions?

suby
11 - Bolide


what I'm trying to achieve is I have two excel files ( Two months Data) with two tabs with different schema and I want to combine all these into one single Dataset which can be done by creating the Nested macro mentioned in the post below by Andrew.

 

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Read-in-Multiple-Excel-Files-with-M...

 

The solution By Andrewl combines the Data set when we run the workflow based on different schema with multiple tabs and Multiple sheets.

 

What I'm looking for is still I want to combine two files with different schema and I should be able to filter for specific worksheet in my main workflow and then do combine the data set on my main workflow say.

 

I'll leave this open for the community geeks to see if any one can provide a solution.

24 REPLIES 24
mceleavey
17 - Castor
17 - Castor

Hi @suby ,

 

I have two macros that do this for you. The first reads in the sheet names and appends to the filename. The second reads each file in dynamically and creates a single file of all inputs.

I've attached the macros and and example workflow.

 

I hope this helps,

 

M.



Bulien

suby
11 - Bolide

Hello,

 

Thanks for your time.

 

Could you please advise or plug in my sample Data set to your macro please struggling a bit to understand on what it does.

mceleavey
17 - Castor
17 - Castor

Hey @suby , no problem.

 

I've attached the workflow. You'll need to save the macros I sent previously to your macro folder, and then you'll need to point the first tool to your folder location where the files are stored.

 

M.



Bulien

suby
11 - Bolide

suby_0-1620218397964.png

Hi,

 

I pointed the Directory tool where the files are stored but still getting this error.? can help

mceleavey
17 - Castor
17 - Castor

Did you save the macros to your macros folder? This is saying it can't find them.



Bulien

suby
11 - Bolide

Hello,

 

I saved the workflow in folder called Download3 and created a sub directory within that folder called Macro and copied two macros still I'm getting the same error.

mceleavey
17 - Castor
17 - Castor

Hi @suby ,

 

no you need to save the macros in your macro folder.

Go to Options->User Settings->Edit User Settings:

mceleavey_0-1620219537867.png

 

Then click on the "Macros" tab:

mceleavey_1-1620219570232.png

 

This shows where your macros are saved. If you don't have one, create a folder somewhere convenient and click the + sign here. Navigate to that folder. This is now your designated macros folder.

The macros I sent previously, the .yxmc files, need to be saved in this folder.

 

Once you've done this, close and re-open Alteryx, then try the workflow I sent.

 

M.

 

 



Bulien

suby
11 - Bolide

Hello,

Apologize i did followed the same steps as you mentioned and i saved the Macros in my My Macros Folder and the workflow is saved under the Downlead 3 folder and still I'm facing the issues.

 

suby_0-1620221534210.png

 

mceleavey
17 - Castor
17 - Castor

Hi @suby ,

 

I'm not sure what the problem is, but if you've saved the macros in the correct folder you should see them in the In/Out section:

mceleavey_0-1620223154139.png

 

If so, you can simply replace the first error file with the "Dynamic Multi File Sheet Names" macro, and the second with "Input Multiple Scheme Flat Files" macro. Connect them up as previously shown (set the parameter to be Fullpath) and you're good to go.

 

M.

 



Bulien

Labels