table add calculated columns, table insert calculated columns
This function inserts one or more columns into the table where the intial values are calculated row-by-row with the expressions provided.
Indirect parameter passing is disabled
min. 3
No. | Type | Description |
---|---|---|
1. input |
string | Name of existing table |
opt. 2 input |
table column | Destination column Applicable for table insert calculated columns only. The other function table add calculated columns
adds all columns at the right end of the table. See table columns as function parameters for general ruling for this parameter.
The new column will be inserted to the left. To insert them to the right, using shifted Table Column Specifications is a possible option, or use column numbers. Negative indexing is supported, where -1 adds the new column after (and not before) the last column. |
2 / 3 input |
table columns | Header names columns to add See table columns as function parameters for general ruling for this parameter.
|
3, 4.. / 4, 5,... code |
expression :string |
expressionfor initial values The expressions will be calculated for every row so the initial values may differ from row to row. Ideally, provide the same number of expressions as the number of columns specified. If more expressions are provided than the number of columns specified, then the excess expressions will not be calculated. If fewer expressions are provided than the number of columns specified, then the uncovered columns will be initialzed with blanks. |
Type | Description |
---|---|
numeral | Number of headers inserted -1 is returned if no header row has been found |
Table not found
table initialize( t,
{ { First Name, Last Name },
{ Abel, Adams },
{ Betty, Beavers },
{ Charlie, Collins },
{ Daniela, Douglas } } );
table copy table (t, u );
table add calculated columns( u, { Full Name, Abbreviation, Character Count },
[First Name] + ' ' + [Last Name], left([First Name], 1), [Full Name]{} );
table list( u );
table insert calculated columns( t, 0, { Full Name, Abbreviation, Character Count },
[First Name] + ' ' + [Last Name], left([First Name], 1), [Full Name]{} );
table list( t );
0 : First Name | Last Name | Full Name | Abbreviation | Character Count
1 : Abel | Adams | Abel Adams | A | 10
2 : Betty | Beavers | Betty Beavers | B | 13
3 : Charlie | Collins | Charlie Collins | C | 15
4 : Daniela | Douglas | Daniela Douglas | D | 15
0 : Full Name | Abbreviation | Character Count | First Name | Last Name
1 : Abel Adams | A | 10 | Abel | Adams
2 : Betty Beavers | B | 13 | Betty | Beavers
3 : Charlie Collins | C | 15 | Charlie | Collins
4 : Daniela Douglas | D | 15 | Daniela | Douglas