Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

update fields

salangc
5 - Atom


I'm new in Alteryx and I'm having a hard time to find solutions or tools with the below

I have rules to apply in my data .. how do I do these in alteryx

1st rule I need to copy the account number to another field (in another existing column)

With these accounts, tag with the actual account number

4555698 4558799 4556389

2nd rule I need to update field (in another existing column)

With remaining untagged accounts, tag as follows

accounts starting with 41, tag as '4199324'

accounts starting with 42, tag as '4229935'

3 REPLIES 3
afv2688
16 - Nebula
16 - Nebula

Hello @salangc ,

 

Hope this helps:

 

Untitled2.png

wdavis
Alteryx Alumni (Retired)

Hi @salangc 

 

You can do these using a Formula tool and IF statements. 

 

Within the formula tool you have the option to either update an exisiting field or create a new column.

 

In the first instance you would want a statement along the lines of IF [Field] = 4555698 THEN [Existing Field] + [Field] ELSE [Field] ENDIF

 

The second statement would require you to isolate the first 2 digits first; IF Left[Field], 2) = 41 THEN '4199324' ELSEIF Left[Field], 2) = 42 THEN '4229935' ELSE '' ENDIF

 

I hope this helps

 

Kind Regards

Will

GiuseppeC
Alteryx
Alteryx

Hi @salangc,

 

you should be able to achieve what you need using the Formula tool. You can find it in the blue "Preparation" category on the top ribbon in Designer.

 

The Formula tool allows you to change existing fields with values coming from another field, which should address your 1st rule.

You can also build "IF-THEN-ELSE" statements to address your second rule. You can find the syntax of this statement by clicking on the blue 'fx' button > Conditional within the configuration of the Formula tool, after you've placed it on the canvas in your workflow.

 

You can use the Left([Field], 2) function to test the first 2 characters of your field.

 

Finally, if you left click on the Formula tool on the ribbon (not in the actual workflow) > Open example, you should be able to see multiple configurations of this tool and learn it from there.

 

Hope this helps!

Giuseppe

Labels
Top Solution Authors