Assigning Team Based on Position

This pipeline demonstrates how you can use the Categorical to Numeric Snap to assign numeric team values to employees based on their position, which is a categorical field.

  1. Configure the CSV Generator Snap to generate employee data with categorical values.
    name,gender,position,experience
    andy,male,technical_writer,11
    jeff,male,technical_writer,22
    mindy,female,instructional_designer,7
    kathy,female,technical_writer,8
    thomas,male,technical_writer,2
    kim,female,technical_writer,9
    bruce,male,technical_writer,4
    john,male,technical_writer,10
    jonah,male,instructional_designer,1
    clark,male,instructional_designer,15
    hal,male,technical_writer,7
    Note: The input document contains employee positions such as technical_writer and instructional_designer as categorical values.
  2. Add the Profile Snap to compute statistics on the input data.

    This Snap calculates the value distribution of the $position field, which is required by the encoding policies in the next Snap.


    Categorical to Numeric Snap Settings

  3. Configure the Categorical to Numeric Snap to encode categorical fields into numeric values.

    The Snap is configured with two encoding policies:

    • Integer Encoding: Maps each unique $position value to an integer and stores it in $team_number.
    • One Hot Encoding: Creates binary fields $team_instructional_designer and $team_technical_writer to indicate presence of those positions.

    Categorical to Numeric Snap Settings


    Categorical to Numeric Snap Output

    Note: The output contains the following new fields:
    • $team_number: Result of Integer Encoding for the $position field.
    • $team_instructional_designer and $team_technical_writer: Result of One Hot Encoding policies.
To successfully reuse pipelines:
  1. Download and import the pipeline in to the SnapLogic Platform.
  2. Configure Snap accounts, as applicable.
  3. Provide pipeline parameters, as applicable.