Skip to main content
Pentaho Documentation

Resolving Missing Zip Code Information

Overview

Explains how to resolve missing zip code information.

After you Retrieve Data from your Lookup File, you can begin to resolve the missing zip codes.

  1. Add a Stream Lookup step to your transformation.  To do this, click the Design tab, then expand the Lookup folder and choose Stream Lookup.
  2. Draw a hop from the Filter Missing Zips to the Stream lookup step. In the dialog box that appears, select Result is FALSE.
  3. Create a hop from the Read Postal Codes step to the Stream lookup step.

ziptransformation_tutorial.png

  1. Double-click on the Stream lookup step to open the Stream Value Lookup window.
  2. Rename Stream Lookup to Lookup Missing Zips.
  3. From the Lookup step drop-down box, select Read Postal Codes as the lookup step.
  4. Define the CITY and STATE fields in the key(s) to look up the value(s) table. Click the drop down in the Field column and select CITY. Then, click in the LookupField column and select CITY. Perform the same actions to define the second key based on the STATE fields coming in on the source and lookup streams: File:/pdi_lookup_values.pngStreamValueLookup_tutorial1.png
  1. Click Get Lookup Fields.
  2. POSTALCODE is the only field you want to retrieve. To delete the CITY and STATE lines, right-click in the line and select Delete Selected Lines.
  3. Give POSTALCODE a new name of ZIP_RESOLVED and make sure the Type is set to String.
  4. Enable Use sorted list (i.s.o. hashtable).​​LookupDialog.png
  5. Click OK to close the Stream Value Lookup edit properties dialog box.​​
  6. Save your transformation.
  7. To preview the data:
    1. In the canvas, select the Lookup Missing Zips step then right-click and select Preview. 
    2. In the Transformation debug dialog window, click Quick Launch to preview the data flowing through this step.  
    3. The Examine preview data  window appears.  Notice that the new field, ZIP_RESOLVED, has been added to the stream containing your resolved postal codes.
    4. Click Close to close the window.
    5. If the Select the preview step window appears, click the Close button.
    6. Note that the execution results near the bottom of the Spoon window shows updated metrics in the Step Metrics tab.