Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Data Cleaning - If Statements

Tommy_Alterax
8 - Asteroid

Hi Guys,

 

Data cleaning in Alteryx using if statements and contains

 

In the sample excel file attached - I am only concerned with the Resource Name equal to 'Labor Vendor 0000025308,' ignore the remaining resource name.  With the Original Name Column I am concerned with the 'John Resourcing ....' only when the resource name is 'Labor Vendor 0000025308,'

 

Basically I want to an IF statement on 2 variables with contains and replace , if it does contain a match

 

If Resource Name equals 'Labor Vendor 0000025308,and Original Name contains (John Resourcing) // Note I do not care about the Month after John Resourcing

Then Resource Name equals John Resourcing

Else Resource Name

End if

 

 

Thanks Tommy

6 REPLIES 6
atcodedog05
22 - Nova
22 - Nova

Hi @Tommy_Alterax 

 

You have attached the wrong excel. can you please provide the right excel.

Tommy_Alterax
8 - Asteroid

Apologies - attached now 

atcodedog05
22 - Nova
22 - Nova

Hi @Tommy_Alterax 

 

You condition is almost giving the formula 

 

IF [Resource Name]="Labor Vendor 0000025308"
and Contains([Original Name], "John Resourcing")
THEN "John Resourcing"
ELSE [Resource Name] ENDIF

 

 overwrite on resource name like this

atcodedog05_0-1605877181830.png

 

Hope this helps 🙂


If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

 

Tommy_Alterax
8 - Asteroid

This doesnt clean the data as I hoped - see output below - the resource name is still Labor Vendor - I was hoping it would be John Resourcing ? 

 

Resource Name                      Original Name
Labor Vendor 0000025308, John Resourcing January
Labor Vendor 0000025308, John Resourcing February
Labor Vendor 0000025308, Billy Resourcing January
Joe Bloggs Null
Steven Seagal Null
Labor Vendor 0000025308, John Resourcing March
Jimmy Hendrix Jimmy Hendrix
Labor Vendor 0000025308, James Resourcing January

atcodedog05
22 - Nova
22 - Nova

Hi @Tommy_Alterax 

 

Here is a workflow for the task.

Was caused because there was commas at the end fixed it

atcodedog05_0-1605878615303.png

IF [Resource Name]="Labor Vendor 0000025308,"
and Contains([Original Name], "John Resourcing")
THEN "John Resourcing"
ELSE [Resource Name] ENDIF

Output:

atcodedog05_1-1605878661843.png

Hope this helps 🙂


If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

Tommy_Alterax
8 - Asteroid

Worked a dream - thank you 🙂

Labels