Select
Choose which columns to keep, rename and reorder them, and convert their data types. New columns pass through by default; turn off Automatically include new columns to keep a fixed selection.
Prepare an order table
This table has an order reference, an amount and an internal note for each order. Select starts by keeping all three columns.
Select interactive example
Loading interactive example…
The live example needs a desktop screen. The result it produces is shown here, and the explanation and settings below work on any screen.
| order | amount | note |
|---|---|---|
| ORD-101 | 12.50 | Checked |
| ORD-102 | 8.00 | Follow up |
| ORD-103 | pending | Awaiting price |
- Clear the Keep checkbox for
note. The notes disappear from the output, while all three orders stay. - Enter
order_idin Rename To for theordercolumn. The output now uses that heading. - Change Type for
amountfromVARCHARtoDOUBLE. The amounts become decimal numbers. Thependingvalue becomes NULL because it can't be converted to a number. - Use the up arrow beside
amountto move it beforeorder. Theamountcolumn now appears first in the output.
When to use
Use Select to keep the columns you need, rename them, reorder them or change their type. To remove rows instead of columns, use Filter.
Read the output
The example starts with three orders. Manual Input reads amount as VARCHAR text only because of the pending value, even though the other amounts look like numbers. Before you change any settings, Select passes those columns through with their original names and types.
After the steps, the output has amount followed by order_id. The internal notes are gone. The amounts 12.5 and 8 are now DOUBLE numbers, while order_id stays VARCHAR text. The order with a pending amount is still present, but its amount is now NULL.
Select changes the output of this block. The table from Manual Input doesn't change.
Choose a type that fits the values
Choose DOUBLE for decimal numbers such as the amounts in this example, or BIGINT for whole numbers. VARCHAR stores text, BOOLEAN stores true or false values, DATE stores dates and TIMESTAMP stores dates with times.
Changing a type converts the values; it doesn't just change how they look.
To have Strata choose data types from the values automatically, see Auto Field.
To keep or remove rows based on their values, use Filter.
Inputs and outputs
Inputs
1 port- InRequired
The table containing the columns you want to keep, rename, reorder or convert.
Accepts: Tables, Geospatial data.
Accepts one connection on this port.
Outputs
1 port- Out
The selected columns in the order shown in the settings, with any names and data types you have changed. All input rows are kept.
Configure the block
The Columns grid lists the fields from the connected input. Each row controls one output column. A chosen column missing from the input is skipped with a warning, and its settings are kept.
- Automatically include new columns
Pass through new input columns without changing their names or types.
- Column
Shows the original input column name, even after you rename it in the output.
- Keep
Select to include the column, or clear to exclude it. Keep at least one column selected. All input rows stay.
- Type
Leave the current type selected to preserve it, or choose a new output type. Values that can't be converted become NULL.
- Decimal places
Digits kept after the decimal point. Values round to this many places.
- Total digits
Maximum digits in the value, including decimal places. Values that don't fit become NULL.
- Rename To
Enter the output column name. Leave blank to keep the original name.
- ↑ / ↓
Move the column up or down in the grid to change its position in the output. This doesn't sort the rows.
Select FAQs
- Does Select remove rows?
- No. Clearing a Keep checkbox removes a column from the output. The rows stay, including rows with values that become NULL during conversion.
- Why did a value become NULL after changing its type?
- Select uses NULL when a value can't be converted to the chosen type. For example, pending can't become a DOUBLE number.
- Can I remove every column?
- No. Select needs at least one column to produce an output. If you clear every Keep checkbox, the block reports an error.
Prepare your data. Build it in Strata.
Strata opens in your browser, with no account.