Skip to main content

Select-Data-Column

Command Description

Select data columns in a datatable and return a new datatable

Command Prototype

objDatatable = Datatable.SelectDataTableColumns(dtTable,aryColumns)

Parameter Description

ParameterRequiredTypeDefaultDescription
dtTableTrueexpressionobjDatatableThe data table to be filtered
aryColumnsTrueexpression[]Columns to be kept

return

objDatatable,The variable used to save the output of the command.

Demo

aryData = [["a", 1], ["b", 2], ["c", 3]] 
aryColumns = ["letter", "number"]
objDatatable = Datatable.BuildDataTable(aryData,aryColumns)
objDatatable = Datatable.SelectDataTableColumns(objDatatable,["letter"])

TracePrint(objDatatable)
/*
letter
0 a
1 b
2 c
*/