# Extract a Subtable from the Table

### Overview

This procedure helps you create a new table from an existing one by choosing which columns and rows to keep or remove. You can include or exclude specific columns and filter rows using selection formulas.

### Input Concepts

| Concept                          | Type            | Description                                                    | Default    | Required |
| -------------------------------- | --------------- | -------------------------------------------------------------- | ---------- | -------- |
| `table`                          | table           | The original table from which the new table will be extracted. | No default | Yes      |
| `included columns`               | list of strings | Columns to include in the new table.                           | All        | No       |
| `excluded columns`               | list of strings | Columns to exclude from the new table.                         | None       | No       |
| `included row selection formula` | string          | Formula to select rows to include.                             | -          | No       |
| `excluded row selection formula` | string          | Formula to select rows to exclude.                             | -          | No       |

### Output Concepts

| Concept | Description         |
| ------- | ------------------- |
| `table` | The extracted table |

### Examples

For the example below, consider the following `table`:

| Name   | Color  | Taste |
| ------ | ------ | ----- |
| Apple  | Red    | Sweet |
| Banana | Yellow | Sweet |
| Lemon  | Yellow | Sour  |

{% tabs %}
{% tab title="Automation" %}

```
extract a subtable from the table where
    the included columns are "Name", "Color"
```

{% endtab %}

{% tab title="Results" %}

| Name          | Color  |
| ------------- | ------ |
| Apple         | Red    |
| Banana        | Yellow |
| Lemon         | Yellow |
| {% endtab %}  |        |
| {% endtabs %} |        |
