Hi there,
I have one excel file with many tabs that I need to load into Alteryx. They are similar but not identical (different schema). I am trying to adapt the batch macro from this post
But I kept receiving error messages saying file path is incorrect. Any idea where I could adjust filepath and how?
Thanks,
Yiling
Solved! Go to Solution.
Hi @yilingchen02. Thanks for linking that article. I have done something similar to the article. I see you need to edit your pathing since (for example) "GOOD" is not a file.
Here's a general flow that should work for you as well.
Thank you. Where would be the place to edit path? Is it in Batch.yxmc? Thanks
You're welcome. You may have to share the workflow or a sample of it. The FilePath variable seems to be incorrect.
That should be the entire file path (e.g., "C:\Users\alex\Downloads\forex_output.xlsx") and it may even include the sheet name (e.g., "C:\Users\alex\Downloads\forex_output.xlsx|||`Sheet1$`").
Sure. See codes and input excel below. My input Sample.xlsx has 3 tabs: each tab has one student and student's height and weight.
Tab 'Alice"
Height | 160 |
Weight | 100 |
Tab 'Bob'
Height | 170 |
Weight | 110 |
Tab 'Charlie'
Height | 180 |
Weight | 120 |
Then I run the New Workflow4.yxmd to combine these into one file. I expected sth like
Height | 160 |
Weight | 100 |
Height | 170 |
Weight | 110 |
Height | 180 |
Weight | 120 |
But instead I got this
How can I tweak the code?
Thanks,
Yiling
Hey, @yilingchen02. I believe the Batch macro is unnecessary. You can achieve the expected output by using a Dynamic Input tool.
Please see the spoiler and the attached workflow.
I simplified my input here. My actual input has different schema hence I need to figure out how to use Batch Macro..
I may need more information. However, try selecting "First Row Contains Data" in the Input Data tool inside the Batch macro.
It did the trick! Thanks @acarter881
You're welcome. Glad it worked.