title: Replace a value on one data set with a value from another data set with a dynamic lookup
body: <p>This question relates primarly to Alteryx, however if it can be done in Python, or R in Alteryx workflow using the R tool then that would work as well.</p>
  
  <p>I have two data sets.  </p>
  
  <p>Address (contains address information: Line1, Line2, City, State, Zip)</p>
  
  <p>USPS (contains USPS abbreviations: Street to ST, Boulevard to BLVD, etc.)</p>
  
  <p>Goal: Look at the string on the Address data set for Line1.  IF it CONTAINS one of the types of streets in the USPS data set, I want to replace that part of the string with its proper abbreviation which is in a different column of the USPS data set.</p>
  
  <p>Example, 123 Main Street would become 123 Main St</p>
  
  <p>What I have tried:
  Imported the two data sets.
  Union the two data sets with the instruction of Output All Fields for When Fields Differ.
  Added a formula, but this is where I am getting stuck.  So far it reads:</p>
  
  <pre><code>if [Addr1] Contains(Sting, Target)
  </code></pre>
  
  <p>Not sure how to have it look in the USPS for one of the values.  I am also not certain if this sort of dynamic lookup can take place.</p>
  
  <p>If this can be done in python (I know very basic Python so I don't have code for this yet because I do not know where to start other than importing the data) I can use python within Alteryx.</p>
  
  <p>Any assistance would be great.  Please let me know if you need additional information.</p>
  
  <p>Thank you in advance.</p>