Alteryx Designer Desktop Discussions

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

Dynamic change a macro's fieldnames

jensroy
9 - Comet

Hi,

 

I have a macro that i want to be used for multipurpose "Share of anything" (share of visits, share of business ...). Right now i have an input that goes into a macro. Here i must match the right fields:

2017-05-09 11_51_41-Alteryx Designer x64 - Share of orders.yxmd_.png

 

I would like the output to Say "Store", "Orders" and "Share of Orders". And if the metric changes to be visits, then i would like the output to say "Store", "Visits" and Share of visits".

 

2017-05-09 11_56_26-Alteryx Designer x64 - SOB test.yxmc.png

 

Attached is the workflow and the macro if anyone could share some insights on how to solve this.

3 REPLIES 3
gc
9 - Comet

What if you did something like this after your Formula tool and before the macro output? Would that work?

StephenR
Alteryx
Alteryx

You can use the dynamic rename tool to change the field names.  The problem is that the macro input renames the fields so that they flows properly within the macro.  This means that field names are static within the macro.  To get around this you will need another text input to give the rename value to the dynamic rename.SOB Sample.PNG

Also, the macro was saved as an iterative macro, but it should be set as standard for this workflow. 

 

 

Regards,
Stephen Ruhl
Principal Customer Support Engineer

patrick_digan
17 - Castor
17 - Castor

@jensroy Here was my technique:

Capture.PNG

1) Use an action tool from the macro input to your select to get back your original field names. I only came across this recently and it's very powerful.

2) Change the macro to a standard macro as @StephenR pointed out.

3) Use the sample tool to grab the first row, transpose it, and then use the multi row formula to get the calculated field to be shares of <<your second field name>>

4) Use the dynamic rename to rename your shares of field.

 

Hope that helps! Your workflow should now be working as expected.

Labels