table read column selected rows
This function extracts a column from the table and places the values in the set from the selected rows where the calculated expression returns true. All blank or non-existing entries will be translated to blank strings. Automatic type conversion (e.g. numbers to numerals) can be adjusted with the table configure() function.
Indirect parameter passing is disabled
This function provides a table context for partial table specifications with table name and row number for selected function parameters
3
No. | Type | Description |
---|---|---|
1. input |
string | Name of existing table |
2. input |
table column | Existing column See table columns as function parameters for general ruling for this parameter.
|
3. code |
expression :string |
Expression to select rows Specify the conditions or rules to select the rows. See expressions to select rows. |
Type | Description |
---|---|
set | Retrieved data Data from the different rows in the same column. |
table initialize ( table 1, { { Animal, leg count },
{ Worm, 0}, { Bird, 2 }, { Dog, 4 }, { Fly, 6 }, { Tick, 8 } } );
echo( table read column selected rows( table 1, Animal, [leg count]>4 ) );
echo( table read column selected rows( table 1, leg count, [leg count]>4 ) );
// Numbers are read as numerals. Force reading them as strings:
table configure( table 1, read numerals, no );
// Pay attention to convert leg counts into nuemrals here.
echo( table read column selected rows( table 1, leg count, num([leg count])>4 ) );
{'Fly','Tick'}
{6,8}
{'6','8'}