select

Reorder table columns.

Reorder the columns in a table according to specified column labels. This operator is useful if you have a table with numerous columns and want to reorder some of them. One of the columns can be "*", which represents all columns in the table except the ones that are listed as arguments.

Operator Usage in Easy Mode

  1. Click + on the parent node.
  2. Enter Select operator in the search field and select the operator from the Results to open the operator form.
  3. In the Input Table drop-down, select the input table.
  4. In the Columns drop-down, enter or select a column.
  5. Click Run to view the result.
  6. Click Cancel to discard the operator form.
  7. Click Submit to add the operator to the playbook.

Usage Details

select(tablename, columns)
-- tablename: name of table to apply an operator
-- columns: list of columns e.g. select(table, col1, col2, col3 ...)

-- NOTE: one of the columns can be "*" which represents all columns in the table EXCEP the one those are listed in the args

Example

Input

col1 col2 col3 col4 col5 col6
123456
select(inputTable, "col2", "col6")
-- should produce table(col2, col6)

select(inputTable, "col2", "col6", "*")
-- should produce table(col2, col6, col1, col3, col4, col5)

select(inputTable, "*", "col2", "col6")
-- should produce table(col1, col3, col4, col5, col2, col6)

select(inputTable, "col2", "*", "col6")
-- should produce table(col2, col1, col3, col4, col5, col6)

select(inputTable, "col2 as newcol1", "*", "col6 as newcol2")
-- should produce table(newcol1, col1, col3, col4, col5, newcol2)

Did this page help you?