system.dataset.filterColumns
Description
Takes a dataset and returns a view of the dataset containing only the columns found within the given list of columns. Since 7.8.1.
Syntax
system.dataset.filterColumns(dataset, columns)
-
Parameters
Dataset dataset - The starting dataset.
PySequence columns - A list of columns to keep in the returned dataset. The columns may be in integer index form (starting at 0), or the name of the columns as Strings.
-
Returns
Dataset - A new dataset containing the filtered columns.
-
Scope
All
Code Examples
Code Snippet
# This example takes the dataset from a five column Bar Chart and displays a subset of the data in two separate tables. This is performed in a button component actionPerformed script.
chartData
=
event.source.parent.getComponent(
'Bar Chart'
).data
northSouth
=
[
1
,
2
]
# North Area, South Area cols
eastWest
=
[
"East Area"
,
"West Area"
]
filteredData
=
system.dataset.filterColumns(chartData, northSouth)
event.source.parent.getComponent(
'NorthSouthTable'
).data
=
filteredData
filteredData
=
system.dataset.filterColumns(chartData, eastWest)
event.source.parent.getComponent(
'EastWestTable'
).data
=
filteredData