I have users uploading excel file to run the workflow - now for certain files the data start from a specific row. Whats the best way to do this either handle it from my end or ask user to update the header row number?
Does your data contain same headers? If yes, then you can handle that in your workflow by simply filtering it.
If not, what I would do is find where the number of nulls become least, that should be where your actual data starts.
This is under the assumption that your data contains instructions or additional info above your actual data. Plug this macro and try. Read your data from 1st line and pass it to this macro.
If it's consistently starting from the same row, it's probably easier for you to build that into your workflow. But if it's variable, then simply having the user remove the preceding rows to conform to a "data profile" is what I generally recommend. In the world of "self-service" tool building, I still think it's okay to put some responsibility on the end user.
I have 20+ templates and each one of them varies
All within the same workflow or are these 20+ different workflows? If all of these inputs/templates follow the same workflow, then I still think it's easier to instruct the user that the data or title must start on Row = 1.
Otherwise, you could consider:
1. Use logic to identify what part of the file are the data rows
2.Use the Multi-Row formula to flag the preceding row for the headers
3. Use the Dynamic Rename to bring the headers back in
Short of that, I think i'd still recommend making the user alter the file.
Hope that helps, -Jay
The number of wires scare me.
filebrowse -> action tool -> text input. filter/whatever -> join on you input line value.map both in batch macro.
Could you please show this through the workflow, Im not exactly familiar with macros
Note: You're not often going to get something like this built in a workflow without a starter workflow to show what you're actually doing. But, I can see what's happened here... those 17 control containers scare me as well, I can't imagine the config in there. People can help to solve an issue, but this is an example where if there was demo data, it may have been quicker, although demo data is **bleep** an app, especially with multiple files that could go into it.
Try this, your files in the screenshots in both posts seem to all have the system type at the start of the filename and so you can programmatically get that and make your decisions. The key is having it expect no headers but bring in the filename.
If you then have different fieldname expectations per file, you may want to use a Lookup with the field names listed and a Dynamic Select, but I don't know what your data is then going to do, or how normalised it is. Your select and filters may still need a little planning but you should be able to do this in a couple of different pathways, rather than one per file.
I'm working on the premise that you're just renaming etc. I suggest a list of fieldnames, and the what they are renamed to, then a dynamic rename to update, assuming there are not 2 files with the same fieldname that need to be renamed to something else.
Thank you for spending your valuable time on sharing this. its a bit different in my scenario as I dont need to find the header row, I need to define it beforehand for each branch. As above headers there could be other irrelevant data.
My worfklow is already way too complicated, as one of the replies above suggested asking users to delete extra rows before uploading the file. Probably they will not have any issues in doing that as 1hr+ job is reduced to 30 seconds of deleting rows and uploading.
@Faisal___28 if you want to build useful Alteryx workflows with dynamic components --- learn macros --- specifically learn batch macros. You don't need 17 containers or whatever --- you need to learn batch macros and figure out your logic for what flows to what container.
I tend to ask end users not to touch their input files. I do this because sooner or later they do something 'helpful' like change the formatting of a timezone, or do something else which breaks everything downstream.
Otherwise, you can also follow the suggestion from @apathetichell a couple comments back, whereby you put an extra Interface tool with the FileBrowse, asking the user which row the headers are on, and pass that to the Input tool as well.
Thank you. This worked perfectly. Much appreciated.