Math
Apply a mathematical calculation.
Apply mathematical calculations to columns. Also called as maths.
info
Spaces within column headers are replaced with underscores automatically. Account for this when writing expressions in input.
Parameters
| Name | Description | Accepted Values | Default | Required |
|---|---|---|---|---|
| I/O | ||||
input | The mathematical expression using column names. e.g. column1 * column2 + column3. Note: spaces within column names are replaced by underscores (_). | string | — | Yes |
output | The column to output the results to. | string | — | Yes |
| Conditions | ||||
if | Condition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}. | string | — | No |
where | Filter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'. | string | — | No |
where_params | Values used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name. | array, object | — | No |
Examples
wrangles:
- math:
input: sqrt(Values)
output: Square Root
| Values |
|---|
| 4 |
| 9 |
| 16 |
| Square Root |
|---|
| 2 |
| 3 |
| 4 |
Access
| Requirement | Value |
|---|---|
| AI-powered | No |
| Requires WrangleWorks account | No |
| Requires subscription | No |
| Requires external API key | No |
Technical details
| Field | Value |
|---|---|
| Catalog ID | 82 |
| Catalog key | math |
| Recipe key | math |
| Catalog status | active |
| Lifecycle status | active |
| Recipe Writer eligible | Yes |
| Namespace | Root-level |
| Documentation group | compute |
| Aliases | None |
| Runtime symbol | wrangles.recipe_wrangles.main.math |
| Legacy UUID | 494b11ad-00c1-4748-8b93-6bec982f4fec |
Sources