In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Using macro with formula tool to replace field names

andy3590
5 - Atom

I am trying to use a macro text box and action tool to update the field name in a formula, but am having trouble with the syntax to update the formula appropriately.

 

 

Simplifying here, but here is the problem in essence:

 

I have data with four fields - Customer Name, product level 1, product level 2 and product level 3. What I want to do is input via a macro whether the output should pick product level 1, 2 or 3.

  

Formula is as follows: IF !isnull("TBD1") THEN "TBD1" ELSE "TBD2" ENDIF, and I am trying to use the macro input and action tool to replace "TBD1" with the field name I enter as text (could be product level 1, product level 2, or product level 3). I have the action tool set up to replace string "TBD1" and "TBD2" and my macro set up with input of [product level 1], but when I run, the macro is not replacing the field name correctly in the formula tool.

 

Please let me know if any clarifying questions and thanks in advance for any help!

1 REPLY 1
fmvizcaino
17 - Castor
17 - Castor

Hi @andy3590 ,

 

Here is one example on how to change a formula within a macro.

The main thing to configure is the action tool and you need to be careful to not remove something that will make your formula invalid. 

In my example I'm replacing the column name inside the brackets also.

fmvizcaino_0-1589335419022.png

 

Best,

Fernando Vizcaino

 

Labels
Top Solution Authors