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

Alteryx Designer Desktop Discussions

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

Formula to Create Unique ID by Column

mustufa2019
8 - Asteroid

I am trying to create a unique ID by 3 letters of the first name and entire last name. Example, from record  #25 below, combining 3 letters of First Name and Last Name1 would equal to Unique ID of JacConward. However, there are times where Last Name1 column would actually be referring to "middle name", this is when Last Name2 field would have some values. Example, for record #31, I want the output to be KriCleve. So I know the formula would be something like this Left([First Name],3) + [Last Name1] but how can i build an expression/formula where it will see when Last Name2 field has data and it would pick the last name from there? 

 

 

mustufa2019_0-1573626522563.png

2 REPLIES 2
markcurry
12 - Quasar

This should do the trick....

 

IF IsNull([Last Name2]) THEN
Left([First Name],3) + [Last Name1]
ELSE
Left([First Name],3) + [Last Name2]
ENDIF

mustufa2019
8 - Asteroid

@markcurry Perfect - this worked!

Labels