I am trying to make a list of column references to later use in making a stacked data table.
When I make the list inside a function it works perfectly fine. However, when I try the same inside a class method it does not work yielding the error message: "No value to Op Assign"(1, 2).
make_col_list = Function({dt,start,end},
Local({lst,col_list},
Try(
Current Data Table(dt);
col_list = {};
lst = dt << Get Column Names;
For(i=start,i<=end,i++,
Insert Into(col_list,lst[i])
);
,
Throw("Error in col_list: "||char(exception_msg))
);
col_list;
);
);
Above is the function I use in one script. This function currently works no issues.
When I try a similar idea inside of a class however it will not work. Below is how I have it defined inside of the class.
col_list = dt << Get Column Names;
show(col_list);
show(col_list[26]);
Try(
For(pv_i=27,pv_i<=696,i++,
show(col_list[pv_i]);
Insert Into(pv_lst,col_list[pv_i]);
);
,
Throw("Error in pv columns: "||Char(exception_msg));
);
Try(
For(zv_i=16,zv_i<=25,zv_i++,
Insert Into(zv_lst,col_list[zv_i]);
);
,
Throw("Error in zv columns: "||Char(exception_msg));
);
Try(
For(wr_i=26,wr_i<=361,wr_i++,
Insert Into(wr_lst,col_list[wr_i]);
);
,
Throw("Error in work columns: "||Char(exception_msg));
);
Try(
For(dr_i=362,dr_i<=696,dr_i++,
Insert Into(dr_lst,col_list[dr_i]);
);
,
Throw("Error in drive columns: "||Char(exception_msg));
);
I have multiple groups of columns I am trying to select and manipulate.
I originally tried to use a method like this:
pv_lst = Column(26::696);
but was unable to get this to work either.
Any help in how to properly generate a list or collection of column references would be great.