I'm facing some errors while creating Alteryx macro. indeed of help.
Below is the screen shot of the data which I have.
My requirement is to change the column name A/C to GL Account Number and BU to Business Unit and Amt to Amount.
For that I have created a macro with drop down tool and i'm facing some error. Below is the screenshot of the macro.
The Final workflow looks like the screenshot below.
Final Result Expected Using Macro
I have also attached the workflow for your reference.
Solved! Go to Solution.
I must be missing something here but why would you need a macro to change the names of those fields? Wouldn't the select tools be easier / faster?
Hi @Rihan_Mohamed,
Will the column names being fed into this macro change depending on the data source? If not, then I agree with @jeff_reynolds and would recommend using a Select tool. If you're wanting this to be more dynamic then there's a case for a macro, but a fairly simple one. Does this accomplish what you're looking for?
Edit: After thinking on this and reading @T_Willins response I don't think the above will help - it's really no better than using a Select tool.
Hi @Rihan_Mohamed,
If the incoming fields are always the same as the data below and just need to be renamed, then @jeff_reynolds is correct that a Select tool (or any other tool in your workflow that accepts field renames) is the best. If the field names can change, are they always in the same order (account, business unit, amount) or have another rule that makes them easily machine identifiable, then a macro is not needed, just additional steps to get to the field renames. However, if the person running the workflow must specifically identify these fields, then you would likely need chained apps instead of a macro. The questions asked at the macro input are not dynamic based on how you have set it up. Since the questions are asked before the workflow is run, the macro doesn't yet know what fields are in the input to put in the interface tools. Chained app will run the first app to run to find the field names to fill in the interface tools, then the beginning of the second app will ask the questions of which field names should be mapped where.
hi @kelsey_kincaid @T_Willins, @jeff_reynolds
I want to use this sequence of workflow as a development program and the above given is just an example.
Usually we will be getting different data set with different column headers. So, we need to map the required field to make it consistent.
My Requirement
I will be getting files in .txt or .csv format with more that 40 column headers. So initially i need to use drop down macro to take 10 mandatory columns and make the mapping consistent. So that i can continue my workflow creation.
I checked the macro you shared but i cannot find and drop down tool used for mapping the column fields.
Thanks @deviseetharaman this works, but suppose i need to include an additional column source in the mapping file what change i need to make in this workflow.
@Rihan_Mohamed, You will have to add all you mandatory fields (all that you know with correct field names that the user can understand) in the Macro's Text Input configuration. Also the same fields should be there in the Text Input (#4) in the Macro.
User | Count |
---|---|
17 | |
15 | |
15 | |
8 | |
6 |