How do i Stack newly created column without specified namingnum_columns = 3;
col_names = Associative Array();
For(i = 1, i <= num_columns, i++,col_name = Char(400 + (i - 1) * 100);ATOM0TABLE << New Column(col_name, Character, Nominal, formula(Word(i, :FINAL_RESULT, "_"), ""));
col_names[i] = col_name);
stacktable = ATOM0TABLE << Stack(
Columns ( col_names), // List of columns to stack
Source Label Column("Label"), Stacked Data Column("Data"),
Output Table("stacktable"));Was trying to create 3 columns with column name 400 and continuously till 600 and gonna stack those newly column. It works fine till creating the column but not able to stack the column as is showing "Column not found in access or evaluation of 'Bad Argument'
Empty()"
Data AccessRe: How do i Stack newly created column without specified namingYou are trying to use Associative Array as input for << Stack. You can get the values from associative array by using << Get Values. (thought un this case it might be better to use list).
Names Default To Here(1);
dt = New Table("",
Add Rows(1),
New Column("FINAL_RESULT", Character, Nominal, Values({"TEST1_TEST2_TEST3"}))
);
num_columns = 3;
col_names = {};
For(i = 1, i <= num_columns, i++,
col_name = Char(400 + (i - 1) * 100);
new_col = dt << New Column(col_name, Character, Nominal, formula(Word(i, :FINAL_RESULT, "_"), ""));
Insert Into(col_names, new_col << get name);
);
stacktable = dt << Stack(
// Columns(col_names << get values), // if using associative array
Columns(col_names),
Source Label Column("Label"),
Stacked Data Column("Data"),
Output Table("stacktable")
);
Re: How do i Stack newly created column without specified namingThanks you and I am able to stack those column now.