I was wondering if there is a way to select an entire column from a dataset. From what I saw it seems like:
- You can select a single value from a dataset (row,column)
- You can use a column selector and hide it to select a particular & entire column from a dataset
However, is there something like item 1 but includes only {dataset}(column)? or is it possible to query a dataset?
Thanks
There currently isn’t an expression to select a subset of the columns in a dataset, but this would certainly be useful.
In the meantime, it can be done with scripting fairly easily. Suppose you put the following script in an “app.dataset” global module:
def selectColumns(dataset, columns):
import fpmi
pds = fpmi.dataset.toPyDataSet(dataset)
newRows = []
for row in pds:
newRow = []
for c in columns:
newRow.append(row[c])
newRows.append(newRow)
return fpmi.dataset.toDataSet(columns, newRows)
Then the following code would take a dataset from table T1 and apply only some if its columns to table T2:
table1 = event.source.parent.getComponent("T1")
table2 = event.source.parent.getComponent("T2")
table2.data = app.dataset.selectColumns(table1.data, ['Some Col','Another Col'])
Hope this helps,
Thanks for your response. I think that should work for now.