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
Solved! Go to Solution.
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
Hope this helps 🙂
If this post helps you please mark it as solution. And give a like if you dont mind 😀👍
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
Here is a workflow for the task.
Was caused because there was commas at the end fixed it
IF [Resource Name]="Labor Vendor 0000025308,"
and Contains([Original Name], "John Resourcing")
THEN "John Resourcing"
ELSE [Resource Name] ENDIF
Output:
Hope this helps 🙂
If this post helps you please mark it as solution. And give a like if you dont mind 😀👍
Worked a dream - thank you 🙂