The **Add Column** function allows you to create new columns for existing datasets.

When adding a new column, you must create a mathematical expression. This expression evaluates each row in the dataset to generate the new column.

In Studio, expressions are created using a combination of:

- **Column names**, referencing the values of other columns in the table.
- **Constant values**, such as numbers or strings.
- **Mathematical operators**, such as plus, minus, or parentheses. See the [expression syntax](https://docs.foursquare.com/analytics-products/docs/expressions-overview#expression-syntax) reference.
- **Function calls** to Studio's built-in library of [mathematical and geospatial functions](https://docs.foursquare.com/analytics-products/docs/expressions-math).

## Add a New Column to Studio

Follow the steps below to add a new column in Studio:

1. Navigate to the **Columns** tab, select a dataset, then click **Add Column**.

2. Write an expression in the field provided.

After [creating a new column](https://docs.foursquare.com/analytics-products/docs/data-add-column) the expression editor appears. Expressions can be simple, employing simple math operators and column names. To find more [advanced functions](https://docs.foursquare.com/analytics-products/docs/expressions#expression-function-library), check out our library of built-in functions in the left sidebar.

Type or drag and drop the function into the editor. When you start typing a function, all matching functions, and their descriptions along with expected parameters will appear in the editor.

Be sure to preview the results of your column in the [preview of your dataset](https://docs.foursquare.com/analytics-products/docs/data-view-data) below the editor.

3. Click **Confirm** to create your new column.

The new column will appear on the top of the dataset's attribute columns.

Columns created in Studio have a badge, which you can click to open the Edit Column panel.

## Examples

The following are examples of simple expressions. For additional guidance, [visit the Expressions documentation](https://docs.foursquare.com/analytics-products/docs/expressions).

Compute the ratio of two attributes:

```typescript
attribute_column_one / attribute_column_total;
```

Calculate the absolute value of a column with 20 subtracted:

```typescript
abs(column_example - 20);
```

Index data to H3 at resolution 9:

```typescript
geoToH3(lat, lng, 9);
```

Truncate a Placekey to just the Where Part:

```typescript
substring(placekey, indexOf(placekey, "@"));
```

Pad a string with zeroes:

```typescript
padStart(zip, 5, "0");
```

Find the centroid of a polygon:

```typescript
centroid(_geojson);
```

Parse a `string` into a `timestamp`:

```typescript
parseTime(time);
```
