Converting Numeric Data into Categorical Values

This pipeline demonstrates how to use the Numeric to Categorical Snap to convert numeric fields into categorized groups based on their values.

  1. Configure the CSV Generator Snap to generate input data.

    Use the following values to simulate sample employee data:


    CSV Generator Input Data

  2. Pass the input to the Type Converter Snap to convert values in the $experience field to numeric format.
    Note: Ensure that the Auto check box is selected in the Type Converter Snap.
  3. Use the Copy Snap to duplicate the converted data stream.
    The Copy Snap feeds two parallel outputs:
    • One to the Numeric to Categorical Snap for conversion.
    • The other to the Profile Snap for field-level statistics.
  4. Configure the Profile Snap to compute data statistics on the $experience field.

    Profile Snap Settings


    Profile Snap Output with Min/Max Values

    Note: The $experience field has a minimum value of 1 and a maximum of 22. These values are required for binning-based conversion.
  5. Configure the Numeric to Categorical Snap to categorize numeric values using the Binning method.

    Select Binning as the Rule to convert numeric values in the $experience field into categories: junior, senior, and principal.


    Numeric to Categorical Snap Settings


    Numeric to Categorical Output

    This Snap adds a new field $level to the output that classifies employees based on their years of experience.

  6. Write the output to a file using the File Writer Snap.
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.