Advent of Code is now back for a limited time only! Complete as many challenges as you can to earn those badges you may have missed in December. Learn more about how to participate here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Need help creating a new data field for customers starting with "zz"

dareinnyc
7 - Meteor

Problem 1:

I have a customer list of internal and external customers. Data field "Customers". 

Internal customers are denoted with a "zz" in the beginning of the name. 

I want to create a new data field "Intercompany" which will show YES if "Customers" start with zz. NO for all others.

 

Problem 2:

Create a rolling mapping table which can automatically ensure customer names are consistent. For example, rename all customers containing "Facebook" into "META" and "Google" into "Alphabet". Also instead of using pre-defined formulas, can I use fuzzy logic?

 

Thanks!

5 REPLIES 5
binuacs
21 - Polaris

@dareinnyc For problem 1 you can use the string function StartsWith()

 

IIF( StartsWith([Customers],'zz'),'Yes','No')

 

Problem2 - Use the Find and Replace tool for this use case

jfha97
7 - Meteor

The solution by @binuacs works perfectly, I was going to suggest RegEx (because I've had more experience with it before Alteryx) but StartsWith gets the job done. 

 

Thank you for teaching me more about Alteryx formulas!

dareinnyc
7 - Meteor

Thanks! I used this

 

if(startswith([Client],'zz'),'Yes','No')

 

Came back with 

 

Error: Formula (16): Parse Error at char(28): Malformed If Statement (Expression #1)

 

Where did I go wrong? 

nagakavyasri
12 - Quasar

@dareinnyc  try this

Screenshot 2023-06-09 120750.png

 

binuacs
21 - Polaris

@dareinnyc your formula starting with IF, but it should be IIF

Labels
Top Solution Authors