I'm having a hard time understanding Alteryx macros. I have read most of the documentation yet I don't seem to be able to build a functioning standard macro and frankly the tools are a mess.
I have a very, very simple macro workflow with a formula tool that times a field by 2. I'd like to input that into any other workflow and select the columns I want to multiply. Yet for some reason I have two input anchors and an interface that wants to group my data.
Any help would be appreciated.
Solved! Go to Solution.
Hi @Peter4,
there were two input anchos because it wasn't a standard macro, it was selected to be a Batch-Macro.
Second:
You can remove your Interface-Tools to achieve this behaviour:
You can than click on the Macro-Input and select "Show Field Map".
This will enable a dialog in the configuration of the macro when you use it:
You can easily pick the column here and get the result you want!
Example Input: (I picked Field1 to be doubled)
Example Output:
Fixed Macro attached. Let me know if I got it right.
Best
Alex
PS: Cool Macro-Icon!
Great thanks! I think it switched to a batch macro because I dragged the control parameter tool onto the canvas. How can I keep the name of my original field without replacing it with "example" in this case?
You could achieve this using an Action Tool in combination with a Select Tool:
The default setting "Update Select with Reverse Field Map (Default)" does the job. This will rename the column to the original name.
The output now looks like this:
I'll attach the adapted version.
Best
Alex
Perfect, thank you!
I do it this way:
I changed the formula back so they would work even in the test run in the macro itself.
You can use the "Update Value (Default)" and the Option "Replace a specific string". Remove everything from the String besides the thing you want to be replaced - in this case 125. The Tool will now swap 125 and the number you picked in your Numeric Up Down Picker..
Updated Macro attached.
Best
Alex
Thank you. I think I'm getting the hang of it.
What does 'Update Value with formula' do? Or how could I practise usnig that?
To be honest, I have never used the 'Update Value with formula'. Usually you just want to replace a specific part of something and can do this with the 'Replace specific String' Option.
I could see use cases if you would like to use something like a Regex-Replace or Regex-Match, but to be honest again, I would do this different and not do it with the 'Update Value with formula' option.