Datatable-Deduplicating
Command Description
Remove duplicated lines in a datatable
Command Prototype
objDatatable = Datatable.DropDuplicatesDataTable(dtTable,aryColumns,strKeep)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
dtTable | True | expression | objDatatable | The data table to be filtered |
aryColumns | True | expression | [] | Columns that need to be deduplicated and retained |
strKeep | True | enum | "first" | Columns that need to be deduplicated and retained |
return
objDatatable,The variable used to save the output of the command.
Demo
aryData = [["a", 1], ["b", 2], ["c", 3], ["d", 1]]
aryColumns = ["letter", "number"]
objDatatable = Datatable.BuildDataTable(aryData,aryColumns)
objDatatable = Datatable.DropDuplicatesDataTable(objDatatable,["number"],"last")
TracePrint(objDatatable)
/*
letter number
1 b 2
2 c 3
3 d 1
*/