Alteryx Designer Desktop Discussions

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

File "x" has a different number of fields than the 1st file in the set and will be skipped

JoseMignone
7 - Meteor

Hi everyone,

 

I know that this has been already asked before by other users, but I really can´t understand the macro solution. I am basically bringing all the files I need by "Directory" Tool, and after specifying the sheet I want to focus on (with the Formula Tool), I work on one example file in "Dynamic Input" so it can be replicated in all the other files and just get the info I need. But now (once again) I am having this issue of different number o fields, or different schema that makes the workflow ignore a lot of files.

 

Can someone please help me with this problem? I am really stucked in here.

 

Thanks in advance,

7 REPLIES 7
mceleavey
17 - Castor
17 - Castor

Hi @JoseMignone ,

 

I built a couple of tools to do exactly this.

The problem is that when you try to use the Dynamic Input tool you need to select a template, which the common format of each file input. If the schema changes, for example different columns exist, then the dynamic input tool will error.

 

I've attached the two tools and an example workflow:

 

mceleavey_0-1623091273785.png

 

The first tool reads in every sheet name within each workbook and adds it to the filename as you need this when loading in Excel files. This then gets joined back to the main stream to be loaded into the second tool:

 

mceleavey_1-1623091511074.png

 

The second tool uses the fullpath field, which now includes each sheet name as well and loads them all in.

 

mceleavey_2-1623091549630.png

 

 

You can place a filter after the first tool to only select the sheets you want if required.

 

I've attached an export of the example workflow (the .yxzp file) which you can use if you're on version 2021.2 or higher.

If not, you can open them all manually and save the macros to your macro folder.

 

I hope this helps.

 

M.



Bulien

Qiu
21 - Polaris
21 - Polaris

@mceleavey 
I can see some improvements comparing with the one I have saved.

Thank you. 😁

JoseMignone
7 - Meteor

@mceleavey thank you very much for your help. The truth is that I was looking for something simpler because I am new at alteryx, but I appreciate your help and after I understood a little more about the matter I got some new ideas from your comment.

 

I will also attach this video from youtube that really help me to understand how to join many files with different schemas that is very similar to one explanation that I saw in the community, but easier to follow for new members like me:

 

https://www.youtube.com/watch?v=MjGxzsMJINQ

 

Regards!

kcoleman
8 - Asteroid

Hi all,

 

I'm trying to stack a tab from 500+ files on top of each other but I'm getting this error 'has a different number of fields than the 1st file in the set and will be skipped'. 


Any ideas? Workflow is attached.

Marko1986
7 - Meteor

Hello guys.

 

I'm here with the same problem but I just can't see why it is not working. I have 16 sheets that have exactly 7 columns each with the same name and same string type that I've checked. Still I get the error that fields are not the same and will be skipped.

What is the situation with that, why Alteryx sometimes just don't want to cooperate :)

 

Thanks

bradyudovich
5 - Atom

Did you ever solve this? I am running into the same issue..

Marko1986
7 - Meteor

I solved it manually as a format painted every sheet. After that I realized there is CREW macro for input of those kind of files so try to use it.

Labels