Skip to main content

Split one column into multiple columns with the Explode Columns service

Split one column into multiple columns with the Explode Columns data service in Productsup.

Introduction

If your data feed contains a column with a list of values, you can split the column into multiple columns using the Explode Columns data service.

For example, you have the following data at the import stage and wish to split the color column:

id

color

1

red, green, blue

2

gray, black, blue

After applying the Explode Columns data service, your output may look similar to the following:

id

color_1

color_2

color_3

1

red

green

blue

2

gray

black

blue

Note

The Explode Columns data service is available for the import and intermediate stages.

Prerequisites

To set up the Explode Columns data service, you need:

  1. A product identifier. See Set a product identifier for more information.

  2. A column in your feed that contains a list of values separated by a delimiter.

Add the Explode Columns data service

  1. Go to Data Services from your site's main menu and select ADD SERVICE.

  2. Search for Explode Columns, select Add, and give it a desired name and column prefix.

    By default, ___exploded is the column prefix.

    Explode Columns
  3. Choose the stage containing the columns you want to split in Service Data Level and select Add.

  4. Select the column you want to split from the drop-down list Column that will be split into multiple columns.

    Note

    If you choose Import in Service Data Level in Step 3, the drop-down list Columns that will be split into multiple columns displays the columns of your import stage. If you choose Intermediate, the drop-down list contains your intermediate-stage columns.

  5. In Delimiter, select the delimiter that separates the values in the column you want to split.

  6. Select Save.

    Explode columns data service
  7. Repeat steps starting with Step 4 if you want to split more columns with the Explode Columns data service. The platform shows all exploded columns in a table at the bottom of the data service setup page.

    Exploded columns list
  8. For the platform to process a new data service, select Run in the top-right corner of your site's view.

Edit the Explode Columns service

  1. Go to Data Services from your site's main menu.

  2. Search for your data service.

  3. Select the cogwheel icon () next to the desired data service to edit other settings.

  4. Select Save.

Delete the Explode Columns service

  1. Go to Data Services from your site's main menu.

  2. Select the cogwheel icon () next to the desired data service.

  3. In the Danger Area panel, select Remove this service.

  4. Select Yes.