Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Dash (-) causing error - How to fix it using batch macro?

udles5666
8 - Asteroid

Hello Community 

I have an excel dataset with 50 tabs having 48 columns in each tab. The structure of the column doesn't change but, few values of a field have a - (dash) which i think is causing an issue for Dynamic input tool.  Can you please help me resolve this? I tried to build a macro but got stuck and couldn't figure out a way forward. Shall i be using a macro though for it? 

Appreciate help in advance. Workflow with dummy data attached. Thanks heaps :)

 
 
5 REPLIES 5
Gaurav_Dhama_
12 - Quasar

Yes, you will have to use macro for this scenario.

Why? Because in one sheet you have just normal letters, while in another sheet you have special characters like -. What happens?

Normal characters will result is data type v_string, while data with special character will result in v_wstring. These two have different ways they handle string. So, you get schema error.

JosephSerpis
17 - Castor
17 - Castor

Hi @udles5666 have a look at the solution from this post it uses two batch macros the first get a list of the sheets so it's dynamic then a formula tool builds the filepath including the sheets and then retrieves all the data from those sheets.

dreldrel
8 - Asteroid

Just an idea - maybe you could use an input tool in the batch macro and then just give the file path of those 50 tabs, which can be generated by a formula tool in Alteryx. If this helps, feel free to like the comment and select as a solution

 

https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Batch-Macros-for-Multiple-exce...

udles5666
8 - Asteroid

Hey @JosephSerpis - Apologies for the delayed response.
I am struggling to formulate this macro.

Can you please guide me step by step if possible? I had a crack at it - but, no go. I get stuck where the macro is only pulling up data from one of the tab. There's something I am doing wrong but, can't get hear around. Can you please help me resolve this? Attachments added incl. macro. 

Thanks heaps!  

udles5666_0-1759207175401.png

 

PangHC
13 - Pulsar

@udles5666 it simply because you not change the sheetname. so it just repeat sheet1 with x time of sheets count

Screenshot 2025-09-30 132631.png

Labels
Top Solution Authors