Page tree

Release 5.1




NOTE: Transforms are a part of the underlying language, which is not directly accessible to users. This content is maintained for reference purposes only. For more information on the user-accessible equivalent to transforms, see Transformation Reference.

Extracts a set of values based on a specified pattern from a source column of any data type. The generated column contains an array of occurrences of the specified pattern.

While the new column contains array data, the data type of the new column is sometimes inferred as String. 

Basic Usage

Your source column (myWidgetInventory) is formatted in the following manner:

{ "red":"100","white":"1300","blue":"315","purple":"55"}

The following transform extracts the raw inventory contents of each color:

extractlist col: myWidgetInventory on:`{digit}+`

Output: The generated column contains data that looks like the following array:


Syntax and Parameters

extractlist: col:column_ref on:string_literal_pattern delimiter:string_literal_pattern [quote:'quoted_string'] [as:'new_column_name']

TokenRequired?Data TypeDescription
extractlistYtransformName of the transform
colYstringSource column name
onYstringString literal or pattern that identifies the values to extract from the source column
delimiterYstringString literal or pattern that identifies the separator between the values to extract
quoteNstringSpecifies a quoted object that is omitted from matching delimiters
asNstringName of the newly generated column

For more information on syntax standards, see Language Documentation Syntax Notes.


Identifies the column to which to apply the transform. You can specify only one column.

Usage Notes:

Required?Data Type
YesString (column name)


Identifies the pattern to match. Pattern can be a string literal, Alteryx® pattern, or regular expression pattern.  

Tip: You can insert the Unicode equivalent character for this parameter value using a regular expression of the form /\uHHHH/. For example, /\u0013/ represents Unicode character 0013 (carriage return). For more information, see Supported Special Regular Expression Characters.

For the extractlist tranform, all instances that match this pattern in the source column are extracted into the array list in the new column. Each occurrence in the generated array corresponds to an individual instance in the source; the new column can contain duplicate values.

To create array elements based only on the delimiter parameter, set the following regular expression:


Usage Notes:

Required?Data Type

String (literal, regular expression, or Alteryx® pattern )


Specifies the character or pattern that defines the end of a key-value pair. This value can be specified as a String literal, regular expression, or Alteryx® pattern.

 In the following:

{ key1=value1,key2=value2 }

The delimiter is the comma ( ','). The final key-value pair does not need a delimiter.

For this transform, this parameter defines the pattern that separates the values that you want to extract into the array.

Tip: You can insert the Unicode equivalent character for this parameter value using a regular expression of the form /\uHHHH/. For example, /\u0013/ represents Unicode character 0013 (carriage return). For more information, see Supported Special Regular Expression Characters.

Usage Notes:

Required?Data Type

String (literal, regular expression, or Alteryx pattern )


extractlist col: MySourceValues on:`{alpha}+` delimiter:';' quote:'\"'

Output: Extracts from the MySourceValues column each instance of a string value that occurs before the delimiter. Values between double-quotes are considered string literals and are not processed according to the delimiters defined in the transform. 

Can be used to specify a string as a single quoted object. This parameter value can be one or more characters.

Usage Notes:

Required?Data Type
  • The quote value can appear anywhere in the column value. It is not limited by the constraints of any other parameters.


Name of the new column that is being generated. If the as parameter is not specified, a default name is used.

Usage Notes:

Required?Data Type
NoString (column name)


Tip: For additional examples, see Common Tasks.

Example - extract query parameters from URLs


In this example, a list of URLs identifies the items in the shopping carts of visitors to your web site. You want to extract the shopping cart information embedded in the query parameters of the URL.


The following transform extracts the list of query values from the URL. Note that the equals sign is included in the matching pattern so that you don't accidentally pick up numeric values from the non-parameter part of the URL:

extractlist col:cartURL on:`={digit}+`

The two query parameter values have been extracted into an array of values, including the equals sign, which must be removed:

replace col:cartURL with: '' on: `=` global: true

You can now unnest these values into separate columns:

unnest col:extractlist_cartURL keys:'[0]','[1]'

After you rename the two columns to prodId and Qty, you can drop the column generated by the extractlist transform.


joe.robinson 10012 10054
jack.holmes 21021
tina.jones 104122

Example - Extracting counts from a ragged array using extractlist


The following dataset contains counts of support emails processed by each member of the support team for individual customers over a six-month period. In this case, you are interested in the total number of emails processed for each customer.

Unfortunately, the data is ragged, as there are no entries for a support team member if he or she has not answered an email for a customer. So, the unnest transform is not usable.


If the data is imported from a CSV file, you might need to make some simple replace transforms to clean up the data to look like the above example.


Use the following transform to extract just the numeric values from the supportEmailCount array:

extractlist col:supportEmailCount on:`{digit}+`

You should now have a column extractlist_supportEmailCount containing a ragged array. You can use the following transforms to convert this data to a comma-separated list of values:

replace col: extractlist_supportEmailCount on: `[` with: '' global: true

replace col: extractlist_supportEmailCount on: `]` with: '' global: true

replace col: extractlist_supportEmailCount on: `"` with: '' global: true

Convert the column to String data type.

You can now split out the column into separate columns containing individual values in the modified source. The limit parameter specifies the number of splits to create, resulting in 5 new columns, which is the maximum number of entries in the source arrays.

split col:extractlist_supportEmailCount on:',' limit:4

You might have to set the type for each generated column to Integer. If you try to use a derive transform to calculate the sum of all of the generated columns, it only returns values for the first row because the missing rows are null values.

In the columns containing null values, select the missing value bar in the data histogram. Select the Replace suggestion card, and modify the transform to write a 0 in place of the null value, as follows:

set col: extractlist_supportEmailCount3 value: '0' row: ISMISSING([extractlist_supportEmailCount3])

Repeat this step for any other column containing null values.

You can now use the following to sum the values in the generated columns:

derive type:single value:(extractlist_supportEmailCount1 + extractlist_supportEmailCount2 + extractlist_supportEmailCount3 + extractlist_supportEmailCount4 + extractlist_supportEmailCount5)


After renaming the generated column to totalSupportEmails and dropping the columns used to create it, your dataset should look like the following:





See Also for Extractlist Transform:


This page has no comments.