Free Trial

Alteryx Designer Desktop Discussions

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

Error in changing the Field Mapping using Alteryx Macro

Rihan_Mohamed
8 - Asteroid

I'm facing some errors while creating Alteryx macro. indeed of help.

 

Below is the screen shot of the data which I have.

Rihan_Mohamed_0-1591119229180.png

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.

Rihan_Mohamed_1-1591119512218.png

The Final workflow looks like the screenshot below.

 

Rihan_Mohamed_2-1591119563048.png

 

Final Result Expected Using Macro

Rihan_Mohamed_3-1591119713902.png

I have also attached the workflow for your reference.

12 REPLIES 12
jeff_reynolds
10 - Fireball

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?

 

rename.png

kelsey_kincaid
12 - Quasar
12 - Quasar

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?

kayers_2-1591122277278.png

 

kayers_1-1591122267501.png

 

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.

 

 

T_Willins
14 - Magnetar
14 - Magnetar

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.

Rihan_Mohamed
8 - Asteroid

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.

deviseetharaman
11 - Bolide

Hi @Rihan_Mohamed 

 

Could you try the below:

 

GLA.png

Rihan_Mohamed
8 - Asteroid

Hi @deviseetharaman 

 

I checked the macro you shared but i cannot find and drop down tool used for mapping the column fields. 

deviseetharaman
11 - Bolide

Updated

 

 

Rihan_Mohamed
8 - Asteroid

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.

 

 

 

 

deviseetharaman
11 - Bolide

@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.

 

GLA.png

Labels
Top Solution Authors