

# Data quality recipe steps
<a name="recipe-actions.data-quality"></a>

Use these data quality recipe steps to populate missing values, remove invalid data, or remove duplicates.

**Topics**
+ [ADVANCED\$1DATATYPE\$1FILTER](recipe-actions.ADVANCED_DATATYPE_FILTER.md)
+ [ADVANCED\$1DATATYPE\$1FLAG](recipe-actions.ADVANCED_DATATYPE_FLAG.md)
+ [DELETE\$1DUPLICATE\$1ROWS](recipe-actions.DELETE_DUPLICATE_ROWS.md)
+ [EXTRACT\$1ADVANCED\$1DATATYPE\$1DETAILS](recipe-actions.EXTRACT_ADVANCED_DATATYPE_DETAILS.md)
+ [FILL\$1WITH\$1AVERAGE](recipe-actions.FILL_WITH_AVERAGE.md)
+ [FILL\$1WITH\$1CUSTOM](recipe-actions.FILL_WITH_CUSTOM.md)
+ [FILL\$1WITH\$1EMPTY](recipe-actions.FILL_WITH_EMPTY.md)
+ [FILL\$1WITH\$1LAST\$1VALID](recipe-actions.FILL_WITH_LAST_VALID.md)
+ [FILL\$1WITH\$1MEDIAN](recipe-actions.FILL_WITH_MEDIAN.md)
+ [FILL\$1WITH\$1MODE](recipe-actions.FILL_WITH_MODE.md)
+ [FILL\$1WITH\$1MOST\$1FREQUENT](recipe-actions.FILL_WITH_MOST_FREQUENT.md)
+ [FILL\$1WITH\$1NULL](recipe-actions.FILL_WITH_NULL.md)
+ [FILL\$1WITH\$1SUM](recipe-actions.FILL_WITH_SUM.md)
+ [FLAG\$1DUPLICATE\$1ROWS](recipe-actions.FLAG_DUPLICATE_ROWS.md)
+ [FLAG\$1DUPLICATES\$1IN\$1COLUMN](recipe-actions.FLAG_DUPLICATES_IN_COLUMN.md)
+ [GET\$1ADVANCED\$1DATATYPE](recipe-actions.GET_ADVANCED_DATATYPE.md)
+ [REMOVE\$1DUPLICATES](recipe-actions.REMOVE_DUPLICATES.md)
+ [REMOVE\$1INVALID](recipe-actions.REMOVE_INVALID.md)
+ [REMOVE\$1MISSING](recipe-actions.REMOVE_MISSING.md)
+ [REPLACE\$1WITH\$1AVERAGE](recipe-actions.REPLACE_WITH_AVERAGE.md)
+ [REPLACE\$1WITH\$1CUSTOM](recipe-actions.REPLACE_WITH_CUSTOM.md)
+ [REPLACE\$1WITH\$1EMPTY](recipe-actions.REPLACE_WITH_EMPTY.md)
+ [REPLACE\$1WITH\$1LAST\$1VALID](recipe-actions.REPLACE_WITH_LAST_VALID.md)
+ [REPLACE\$1WITH\$1MEDIAN](recipe-actions.REPLACE_WITH_MEDIAN.md)
+ [REPLACE\$1WITH\$1MODE](recipe-actions.REPLACE_WITH_MODE.md)
+ [REPLACE\$1WITH\$1MOST\$1FREQUENT](recipe-actions.REPLACE_WITH_MOST_FREQUENT.md)
+ [REPLACE\$1WITH\$1NULL](recipe-actions.REPLACE_WITH_NULL.md)
+ [REPLACE\$1WITH\$1ROLLING\$1AVERAGE](recipe-actions.REPLACE_WITH_ROLLING_AVERAGE.md)
+ [REPLACE\$1WITH\$1ROLLING\$1SUM](recipe-actions.REPLACE_WITH_ROLLING_SUM.md)
+ [REPLACE\$1WITH\$1SUM](recipe-actions.REPLACE_WITH_SUM.md)

# ADVANCED\$1DATATYPE\$1FILTER
<a name="recipe-actions.ADVANCED_DATATYPE_FILTER"></a>

Filters the current source column based on advanced data type detection. For example, given a column that DataBrew has identified as containing zip codes, this transform can filter the column based on timezone. The details that you can extract depend on the pattern that is detected, as described in **Notes** below.

**Parameters**
+ `sourceColumn` – The name of a string source column.
+ `pattern` – The pattern to extract.
+ `advancedDataType` – Can be one of Phone, Zip Code, Date Time, State, Credit Card, URL, Email, SSN, or Gender.
+ `filter values` – List of string values that the user wants to filter the column based on.
+ `strategy` – KEEP\$1ROWS or DISCARD\$1ROWS or CLEAR\$1FILTERS or CLEAR\$1OTHERS.
+ `clearWithEmpty` – Boolean `true` or `false`, to clear rows with `empty` instead of `null`.

**Notes**
+ If advancedDataType is **Phone**, then the pattern can be AREA\$1CODE, TIME\$1ZONE, or COUNTRY\$1CODE.
+ If advancedDataType is **Zip Code**, then the pattern can be TIME\$1ZONE, COUNTRY, STATE, CITY, TYPE, or REGION.
+ If advancedDataType is **Date Time**, then the pattern can be DAY, MONTH, MONTH\$1NAME, WEEK, QUARTER, or YEAR.
+ If advancedDataType is **State**, then the pattern can be TIME\$1ZONE.
+ If advancedDataType is **Credit Card**, then the pattern can be LENGTH or NETWORK.
+ If advancedDataType is **URL**, then the pattern can be PROTOCOL, TLD, or DOMAIN.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "ADVANCED_DATATYPE_FILTER",
        "Parameters": {
            "pattern": "AREA_CODE",
            "sourceColumn": "phoneColumn",
            "advancedDataType": "Phone",
            "filterValues": ['Ohio'],
            "strategy": "KEEP_ROWS"
        }
    }
}
```

# ADVANCED\$1DATATYPE\$1FLAG
<a name="recipe-actions.ADVANCED_DATATYPE_FLAG"></a>

Creates a new flag column based on the values for the current source column. For example, given a source column containing zip codes, this transform can be used to flag values as `true` or `false` based on a particular timezone. The details that you can extract depend on the pattern that is detected, as described in **Notes** below.

**Parameters**
+ `sourceColumn` – The name of a string source column.
+ `pattern` – The pattern to extract.
+ `targetColumn` – The name of the target column.
+ `advancedDataType` – Can be one of Phone, Zip Code, Date Time, State, Credit Card, URL, Email, SSN, or Gender.
+ `filter values` – List of string values that the user wants to filter the column based on.
+ `trueString` – The `true` value for the target column.
+ `falseString` – The `false` value for the target column.

**Notes**
+ If advancedDataType is **Phone**, then the pattern can be AREA\$1CODE, TIME\$1ZONE, or COUNTRY\$1CODE.
+ If advancedDataType is **Zip Code**, then the pattern can be TIME\$1ZONE, COUNTRY, STATE, CITY, TYPE, or REGION.
+ If advancedDataType is **Date Time**, then the pattern can be DAY, MONTH, MONTH\$1NAME, WEEK, QUARTER, or YEAR.
+ If advancedDataType is **State**, then the pattern can be TIME\$1ZONE.
+ If advancedDataType is **Credit Card**, then the pattern can be LENGTH or NETWORK.
+ If advancedDataType is **URL**, then the pattern can be PROTOCOL, TLD, or DOMAIN.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "ADVANCED_DATATYPE_FLAG",
        "Parameters": {
            "pattern": "AREA_CODE",
            "sourceColumn": "phoneColumn",
            "advancedDataType": "Phone",
            "filterValues": ['Ohio'],
            "targetColumn": "targetColumnName",
            "trueString": "trueValue",
            "falseString": "falseValue"
        }
    }
}
```

# DELETE\$1DUPLICATE\$1ROWS
<a name="recipe-actions.DELETE_DUPLICATE_ROWS"></a>

Deletes any row that is an exact match to an earlier row in the dataset. The initial occurrence is not deleted, because it doesn't match an earlier row.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "DELETE_DUPLICATE_ROWS"
    }
}
```

# EXTRACT\$1ADVANCED\$1DATATYPE\$1DETAILS
<a name="recipe-actions.EXTRACT_ADVANCED_DATATYPE_DETAILS"></a>

Extracts details for the advanced data type. The details that you can extract depend on the pattern that is detected, as described in **Notes** below.

**Parameters**
+ `sourceColumn` – The name of a string source column.
+ `pattern` – The pattern to extract.
+ `targetColumn` – The name of the target column.
+ `advancedDataType` – Can be one of Phone, Zip Code, Date Time, State, Credit Card, URL, Email, SSN, or Gender.

**Notes**
+ If advancedDataType is **Phone**, then the pattern can be AREA\$1CODE, TIME\$1ZONE, or COUNTRY\$1CODE.
+ If advancedDataType is **Zip Code**, then the pattern can be TIME\$1ZONE, COUNTRY, STATE, CITY, TYPE, or REGION.
+ If advancedDataType is **Date Time**, then the pattern can be DAY, MONTH, MONTH\$1NAME, WEEK, QUARTER, or YEAR.
+ If advancedDataType is **State**, then the pattern can be TIME\$1ZONE.
+ If advancedDataType is **Credit Card**, then the pattern can be LENGTH or NETWORK.
+ If advancedDataType is **URL**, then the pattern can be PROTOCOL, TLD, or DOMAIN.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "EXTRACT_ADVANCED_DATATYPE_DETAILS",
        "Parameters": {
            "pattern": "TIMEZONE"
            "sourceColumn": "zipCode",
            "targetColumn": "timeZoneFromZipCode",
            "advancedDataType": "ZipCode"
        }
    }
}
```

# FILL\$1WITH\$1AVERAGE
<a name="recipe-actions.FILL_WITH_AVERAGE"></a>

Returns a column with missing data replaced by the average of all values.

**Parameters**
+ `sourceColumn` – The name of an existing column.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "FILL_WITH_AVERAGE",
        "Parameters": {
            "sourceColumn": "age"
        }
    }
}
```

# FILL\$1WITH\$1CUSTOM
<a name="recipe-actions.FILL_WITH_CUSTOM"></a>

Returns a column with missing data replaced by a specific value.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `columnDataType` – The data type for the column. This type must be `date`, `number`, `boolean`, `unsupported`, `string`, or `timestamp`.
+ `value` – The custom value to fill in. The data type must match the value that you choose for `columnDataType`.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "FILL_WITH_CUSTOM",
        "Parameters": {
            "columnDataType": "string",
            "sourceColumn": "last_name",
            "value": "No last name provided"
        }
    }
}
```

# FILL\$1WITH\$1EMPTY
<a name="recipe-actions.FILL_WITH_EMPTY"></a>

Returns a column with missing data replaced by an empty string.

**Parameters**
+ `sourceColumn` – The name of an existing column.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "FILL_WITH_EMPTY",
        "Parameters": {
            "sourceColumn": "wind_direction"
        }
    }
}
```

# FILL\$1WITH\$1LAST\$1VALID
<a name="recipe-actions.FILL_WITH_LAST_VALID"></a>

Returns a column with missing data replaced by the most recent valid value for that column.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `columnDataType` – The data type for the column. This type must be `date`, `number`, `boolean`, `unsupported`, `string`, or `timestamp`.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "FILL_WITH_LAST_VALID",
        "Parameters": {
            "columnDataType": "string",
            "sourceColumn": "birth_date"
        }
    }
}
```

# FILL\$1WITH\$1MEDIAN
<a name="recipe-actions.FILL_WITH_MEDIAN"></a>

Returns a column with missing data replaced by the median of all values.

**Parameters**
+ `sourceColumn` – The name of an existing column.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "FILL_WITH_MEDIAN",
        "Parameters": {
            "sourceColumn": "age"
        }
    }
}
```

# FILL\$1WITH\$1MODE
<a name="recipe-actions.FILL_WITH_MODE"></a>

Returns a column with missing data replaced by the mode of all values.

You can also specify tie-breaker logic, where some of the values are identical. For example, consider the following values:

`1 2 2 3 3 4`

A `modeType` of `MINIMUM` causes `FILL_WITH_MODE` to return 2 as the mode value. If `modeType` is `MAXIMUM`, the mode is 3. For `AVERAGE`, the mode is 2.5.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `modeType` – How to resolve tie values in the data. This value must be `MINIMUM`, `NONE`, `AVERAGE`, or `MAXIMUM`. 

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "FILL_WITH_MODE",
        "Parameters": {
            "modeType": "MAXIMUM",
            "sourceColumn": "age"
        }
    }
}
```

# FILL\$1WITH\$1MOST\$1FREQUENT
<a name="recipe-actions.FILL_WITH_MOST_FREQUENT"></a>

Returns a column with missing data replaced by the most frequent value.

**Parameters**
+ `sourceColumn` – The name of an existing column.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "FILL_WITH_MOST_FREQUENT",
        "Parameters": {
            "sourceColumn": "position"
        }
    }
}
```

# FILL\$1WITH\$1NULL
<a name="recipe-actions.FILL_WITH_NULL"></a>

Returns a column with data values replaced by null.

**Parameters**
+ `sourceColumn` – The name of an existing column.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "FILL_WITH_NULL",
        "Parameters": {
            "sourceColumn": "rating"
        }
    }
}
```

# FILL\$1WITH\$1SUM
<a name="recipe-actions.FILL_WITH_SUM"></a>

Returns a column with missing data replaced by the sum of all values.

**Parameters**
+ `sourceColumn` – The name of an existing column.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "FILL_WITH_SUM",
        "Parameters": {
            "sourceColumn": "age"
        }
    }
}
```

# FLAG\$1DUPLICATE\$1ROWS
<a name="recipe-actions.FLAG_DUPLICATE_ROWS"></a>

Returns a new column with a specified value in each row that indicates whether that row is an exact match of an earlier row in the dataset. When matches are found, they are flagged as duplicates. The initial occurrence is not flagged, because it doesn't match an earlier row.

**Parameters**
+ `trueString` – Value to be inserted if the row matches an earlier row.
+ `falseString` – Value to be inserted if the row is unique.
+ `targetColumn` – Name of the new column that is inserted in the dataset.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "FLAG_DUPLICATE_ROWS",
        "Parameters": {
            "trueString": "TRUE",
            "falseString": "FALSE",
            "targetColumn": "Flag"           
        }
    }
}
```

# FLAG\$1DUPLICATES\$1IN\$1COLUMN
<a name="recipe-actions.FLAG_DUPLICATES_IN_COLUMN"></a>

Returns a new column with a specified value in each row that indicates whether the value in the row's source column matches a value in an earlier row of the source column. When matches are found, they are flagged as duplicates. The initial occurrence is not flagged, because it doesn't match an earlier row. 

**Parameters**
+ `sourceColumn` – Name of the source column.
+ `targetColumn` – Name of the target column.
+ `trueString` – String to be inserted in the target column when a source column value duplicates an earlier value in that column.
+ `falseString` – String to be inserted in the target column when a source column value is distinct from earlier values in that column.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "FLAG_DUPLICATES_IN_COLUMN",
        "Parameters": {
            "sourceColumn": "Name",
            "targetColumn": "Duplicate",
            "trueString": "TRUE",
            "falseString": "FALSE"          
        }
    }
}
```

# GET\$1ADVANCED\$1DATATYPE
<a name="recipe-actions.GET_ADVANCED_DATATYPE"></a>

Given a string column, identifies the advanced data type of the column, if any.

**Parameters**
+ `columnName` – The name of the string column.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "GET_ADVANCED_DATATYPE",
        "Parameters": {
            "sourceColumn": "columnName"
        }
    }
}
```

# REMOVE\$1DUPLICATES
<a name="recipe-actions.REMOVE_DUPLICATES"></a>

Deletes an entire row, if a duplicate value is encountered in a selected source column.

**Parameters**
+ `sourceColumn` – The name of an existing column.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "REMOVE_DUPLICATES",
        "Parameters": {
            "sourceColumn": "nationality"
        }
    }
}
```

# REMOVE\$1INVALID
<a name="recipe-actions.REMOVE_INVALID"></a>

Deletes an entire row if an invalid value is encountered in a column of that row.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `columnDataType` – The data type of the column.
+ `advancedDataType` – Special data types that are detected by DataBrew in a column that has the data type `string`. The types that DataBrew can detect within a `string` column include SSN, Email, Phone Number, Gender, Credit Card, URL, IP Address, DateTime, Currency, ZipCode, Country, Region, State, and City.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "REMOVE_INVALID",
        "Parameters": {
            "columnDataType": "string",
            "sourceColumn": "help_url"
        }
    }
}
```

# REMOVE\$1MISSING
<a name="recipe-actions.REMOVE_MISSING"></a>

Returns only the rows in which a specified column isn't missing data.

**Parameters**
+ `sourceColumn` – The name of an existing column.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "REMOVE_MISSING",
        "Parameters": {
            "sourceColumn": "last_name"    
        }
    }
}
```

# REPLACE\$1WITH\$1AVERAGE
<a name="recipe-actions.REPLACE_WITH_AVERAGE"></a>

Replaces each invalid value in a column with the average of all other values.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `columnDataType` – The data type of the column. This type must be `number`.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "REPLACE_WITH_AVERAGE",
        "Parameters": {
            "columnDataType": "number",
            "sourceColumn": "age"
        }
    }
}
```

# REPLACE\$1WITH\$1CUSTOM
<a name="recipe-actions.REPLACE_WITH_CUSTOM"></a>

Replace detected entities with a custom value.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `sourceColumns` – A list of existing column names.
+ `columnDataType` – The data type of the column.
+ `value` – The custom value to be used to replace invalid values.
+ `advancedDataType` – Special data types that are detected by DataBrew in a column that has the data type `string`. The types that DataBrew can detect within a `string` column include SSN, Email, Phone Number, Gender, Credit Card, URL, IP Address, DateTime, Currency, ZipCode, Country, Region, State, and City.

**Note**  
Use either `sourceColumn` or `sourceColumns`, but not both.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "REPLACE_WITH_CUSTOM",
        "Parameters": {
            "columnDataType": "number",
            "sourceColumn": "",
            "sourceColumns": ["column1", "column2"],
            "value": 0
        }
    }
}
```

# REPLACE\$1WITH\$1EMPTY
<a name="recipe-actions.REPLACE_WITH_EMPTY"></a>

Replaces each invalid value in a column with an empty value.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `columnDataType` – The data type of the column.
+ `advancedDataType` – Special data types that are detected by DataBrew in a column that has the data type `string`. The types that DataBrew can detect within a `string` column include SSN, Email, Phone Number, Gender, Credit Card, URL, IP Address, DateTime, Currency, ZipCode, Country, Region, State, and City.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "REPLACE_WITH_EMPTY",
        "Parameters": {
            "columnDataType": "string",
            "sourceColumn": "nationality"
        }
    }
}
```

# REPLACE\$1WITH\$1LAST\$1VALID
<a name="recipe-actions.REPLACE_WITH_LAST_VALID"></a>

Replaces each invalid value in a column with the last valid value.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `columnDataType` – The data type of the column.
+ `advancedDataType` – Special data types that are detected by DataBrew in a column that has the data type `string`. The types that DataBrew can detect within a `string` column include SSN, Email, Phone Number, Gender, Credit Card, URL, IP Address, DateTime, Currency, ZipCode, Country, Region, State, and City.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "REPLACE_WITH_LAST_VALID",
        "Parameters": {
            "columnDataType": "number",
            "sourceColumn": "rating"
        }
    }
}
```

# REPLACE\$1WITH\$1MEDIAN
<a name="recipe-actions.REPLACE_WITH_MEDIAN"></a>

Replaces each invalid value in a column with the median of all other values.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `columnDataType` – The data type of the column. This type must be `number`.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "REPLACE_WITH_MEDIAN",
        "Parameters": {
            "columnDataType": "number",
            "sourceColumn": "games_won"
        }
    }
}
```

# REPLACE\$1WITH\$1MODE
<a name="recipe-actions.REPLACE_WITH_MODE"></a>

Replaces each invalid value in a column with the mode of all other values.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `columnDataType` – The data type of the column. This type must be `number`.
+ `modeType` – How to resolve tie values in the data. This value must be `MINIMUM`, `NONE`, `AVERAGE`, or `MAXIMUM`. 

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "REPLACE_WITH_MODE",
        "Parameters": {
            "columnDataType": "number",
            "modeType": "MAXIMUM",
            "sourceColumn": "height_cm"
        }
    }
}
```

# REPLACE\$1WITH\$1MOST\$1FREQUENT
<a name="recipe-actions.REPLACE_WITH_MOST_FREQUENT"></a>

Replaces each invalid value in a column with the most frequent column value.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `columnDataType` – The data type of the column.
+ `advancedDataType` – Special data types that are detected by DataBrew in a column that has the data type `string`. The types that DataBrew can detect within a `string` column include SSN, Email, Phone Number, Gender, Credit Card, URL, IP Address, DateTime, Currency, ZipCode, Country, Region, State, and City.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "REPLACE_WITH_MOST_FREQUENT",
        "Parameters": {
            "columnDataType": "string",
            "sourceColumn": "wind_direction"
        }
    }
}
```

# REPLACE\$1WITH\$1NULL
<a name="recipe-actions.REPLACE_WITH_NULL"></a>

Replaces each invalid value in a column with a null value.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `columnDataType` – The data type of the column.
+ `advancedDataType` – Special data types that are detected by DataBrew in a column that has the data type `string`. The types that DataBrew can detect within a `string` column include SSN, Email, Phone Number, Gender, Credit Card, URL, IP Address, DateTime, Currency, ZipCode, Country, Region, State, and City.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "REPLACE_WITH_NULL",
        "Parameters": {
            "columnDataType": "number",
            "sourceColumn": "weight_kg"
        }
    }
}
```

# REPLACE\$1WITH\$1ROLLING\$1AVERAGE
<a name="recipe-actions.REPLACE_WITH_ROLLING_AVERAGE"></a>

Replaces each value in a column with the rolling average from a previous "window" of rows.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `columnDataType` – The data type of the column. This type must be `number`.
+ `period` - – The size of the window. For example, if `period` is 10, the rolling average is computed using the previous 10 rows.

**Example**  
  

```
{
    "RecipeStep": {
        "Action": {
            "Operation": "REPLACE_WITH_ROLLING_AVERAGE",
            "Parameters": {
                "sourceColumn": "created_at",
                "columnDataType": "number",
                "period": "2"
            }
        }
    }
}
```

# REPLACE\$1WITH\$1ROLLING\$1SUM
<a name="recipe-actions.REPLACE_WITH_ROLLING_SUM"></a>

Replaces each value in a column with the rolling sum from a previous "window" of rows.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `columnDataType` – The data type of the column. This type must be `number`.
+ `period` - – The size of the window. For example, if `period` is 10, the rolling sum is computed using the previous 10 rows.

**Example**  
  

```
{
    "RecipeStep": {
        "Action": {
            "Operation": "REPLACE_WITH_ROLLING_SUM",
            "Parameters": {
                "sourceColumn": "created_at",
                "columnDataType": "number",
                "period": "2"
            }
        }
    }
}
```

# REPLACE\$1WITH\$1SUM
<a name="recipe-actions.REPLACE_WITH_SUM"></a>

Replaces each invalid value in a column with the sum of all other values.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `columnDataType` – The data type of the column. This type must be `number`.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "REPLACE_WITH_SUM",
        "Parameters": {
            "columnDataType": "number",
            "sourceColumn": "games_won"
        }
    }
}
```