Alteryx Designer Desktop Discussions

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

Combining multiple fields (first name, late name, title) in a specified location (full nam

Debashiss
6 - Meteoroid

Hi, I am a newbie in Alteryx and need help even with the simplest operation. How do I combine 3 fields (first name, last name, title in columns A, B and C) and populate the full name in a prespecified empty column (column D)

7 REPLIES 7
DataNath
17 - Castor

Hey @Debashiss, for combining string elements like this you can simply 'add' them together with +. You'll want to put some spaces in there as well though so if you place a Formula tool on your canvas and select [Column D] from the dropdown (as you're amending this), you can just use an expression like so:

 

[Column C]+' '+[Column A]+' '+[Column B]

 

I've assumed you wanted it in the format of title - first name - last name, but obviously feel free to rearrange if not. Hope this helps!

Debashiss
6 - Meteoroid

@DataNath, thank you for your help. The workflow ran but the destination data column did not populate. I am sending screenshots

Debashiss
6 - Meteoroid

Never mind @DataNath. I think it's because I hadn't completed an output path. Now it works. Thank you SO much. Have a good weekend.

 

DataNath
17 - Castor

Hey @Debashiss, from your 'Dataview' screenshot I can see that you're looking at the input anchor of the Formula tool i.e. what is going in before your expression runs (the blank field). If you hit the green anchor on the right hand side of the tool (output) you'll be able to see the new, populated field after the expression! Can also press here in the results window (red box):

 

1.PNG

Debashiss
6 - Meteoroid

So, now there is another problem. In My input dataset there are records with first, last and title populated and essentially I am populating the full name column by combining them. But there are also records where full names are populated with but corresponding first, last, and title are blank. this workflow logic (not finding any value for those ABC columns is yielding null for the full name column. I tried to go around it by doing the following:
if [PROVIDER_FIRST_NAME] ==!" " or [PROVIDER_LAST_NAME] ==!" " or [PROVIDER_TITLE]==!" "
then
[PROVIDER_LAST_NAME]=[PROVIDER_FIRST_NAME]+" "+ [PROVIDER_LAST_NAME]+" "+[PROVIDER_TITLE]

But it is spitting out errors:

Debashiss
6 - Meteoroid

@DataNath, I am all set. Thank you so much.

 

AlexisPowers
5 - Atom
  1. Open your workflow in Alteryx.

  2. Drag and drop a Formula tool onto your canvas.

  3. Connect it to your input data.

  4. In the Formula tool configuration, you can create a new field in Column D by combining the values from Columns A, B, and C.

    • Click on "Add" to create a new formula.
    • Enter a name for your new field in the "New Field" column, e.g., "Full Name."
    • In the expression editor, you can use a formula like:
      sqlCopy code
      [Column A] + ' ' + [Column B] + ', ' + [Column C]
      This assumes that you want to combine the first name, last name, and title with a space between the first and last name and a comma after the last name.
  5. Click on the OK button to apply the formula.

Now, your workflow should have a new column (Column D) containing the full names based on the combination of the values in Columns A, B, and C.

 

 
Labels