In JSL having trouble adding a new column to a newly transposed datatableHere is the complete log
Log output:
Column not found in access or evaluation of 'Bad Argument'
Send Expects Scriptable Object in access or evaluation of 'Send' , dt_3 << New Column( "Dev", Character, Nominal, "Source" )
In the following script, error marked by /*###*/
dt_1 = Current Data Table();
cc = dt_1 << Get Column Names;
cc[3] << Set Selected( 1 );
For( i = 36, i <= 58, i++,
cc << Set Selected( 1 )
);
dt_2 = dt_1 << Subset( Selected, Output Table Name( "I_tmp" ) );
cc = dt_2 << Get Column Names;
ncols = N Items( cc );
For( i = 2, i <= ncols, i++,
cc << Set Selected( 1 )
);
dt_3 = dt_2 << Transpose(
columns( Selected ),
By( :Column 1 ),
Output Table Name( "I" )
);
dt_3 << /*###*/New Column( "Dev", Character, Nominal, "Source" ) /*###*/;
{}
Re: In JSL having trouble adding a new column to a newly transposed datatableYes, that should work.
(Sorry, I've edited my confusing typos in previous post)
Re: In JSL having trouble adding a new column to a newly transposed datatableColumn(1) refers to first column in table you mean, then i can give Transpose(columns(1,5,8), By(column(4))..... right?
Re: In JSL having trouble adding a new column to a newly transposed datatable:Column 1 refers to Column("Column 1") whereas Column(1) refers to the first column. Column(dt_3, 1) refers to the first column in data table dt_3.
Re: In JSL having trouble adding a new column to a newly transposed datatableFound Partial Answer: Had to change columns(Selected) to (Selected) in
dt_3 = dt_2 << Transpose(
columns( Selected ),
By( :Column 1 ),
Output Table Name( "I" )
);
But, my way referring to first column as :Column 1 in By() is not working. Is there as way to refer to columns by say first, second rather than their actual names?