Data Transformation in Alteryx
Josh Honken
Senior Associate at Knowesis


$$ $$ $$ You can use it to:
Conditional Functions: test data against a condition
IF, ELSEIFIIFLogical Operators: combine statements and allow for increased complexity
AND (&&)OR (||)NOT (!)IF c THEN t ELSE f ENDIF
IF c THEN t ELSE f ENDIF$$
| State | Region | 
|---|---|
| Texas | |
| California | |
| Indiana | |
| New York | 

IF c THEN t ELSE f ENDIFIF [State] = 'TX' THEN 'South' ELSE 'Not South' ENDIF
$$| State | Region | 
|---|---|
| Texas | South | 
| California | Not South | 
| Indiana | Not South | 
| New York | Not South | 


IIF(bool, x, y)IIF([State] = 'TX', 'South', 'Not South'$$
| State | Region | 
|---|---|
| Texas | South | 
| California | Not South | 
| Indiana | Not South | 
| New York | Not South | 


IF c THEN t ELSEIF c2 THEN t2 ELSE f ENDIF
IF [State] = 'TX' THEN 'South' ELSEIF [State] = 'CA' THEN 'West' ELSE 'Other' ENDIF
| State | Region | 
|---|---|
| Texas | South | 
| California | West | 
| Indiana | Other | 
| New York | Other | 

IF [State]='Texas' AND [City]='Dallas' OR [State]='Texas' AND [City]='Fort Worth'
THEN 'Dallas Fort Worth'
$$
ELSE 'No match' ENDIF
| State | City | Dallas Texas? | 
|---|---|---|
| Texas | Dallas | Dallas Fort Worth | 
| Arkansas | Dallas | City matches but not state | 
| Texas | Fort Worth | Dallas Fort Worth | 
| California | San Francisco | No match | 
CONTAINS(String, Target)CONTAINS([Customer Name],'z')| Customer Name | 
|---|
| Claire Gute | 
| Sean O'Donnell | 
| Pete Kriz | 
| Zachary Taylor | 
CONTAINS(String, Target)CONTAINS([Customer Name],'z')| Customer Name | Contains Z? | 
|---|---|
| Claire Gute | 0 | 
| Sean O'Donnell | 0 | 
| Pete Kriz | -1 | 
| Zachary Taylor | -1 | 
The dataset for this course is: Genesis_LLC_Company_HR_Data.xlsx
| Age | Attrition | BusinessTravel | DailyRate | 
|---|---|---|---|
| 51 | 0 | -1 | 684 | 
| 52 | 0 | 0 | 699 | 
| 42 | 0 | 0 | 532 | 
| 47 | 0 | 0 | 359 | 

Data Transformation in Alteryx