Hello, I'm trying to retrieve and prep a list of column names to save in a variable to use later. The issue is that << Get Column Names() returns everything as a list of strings. Below is how I've added in a " : " to the beginning of each item string and what a potential usage of this may be. More still needs to be done.
names default to here(1);
dt = current data table();
col_names = dt << Get Column Names( ); // retrieves all col names
col_list = {}; // list for holding col names
// loop formats names in way usable to be called on as cols, not strings
for( i = 1 , i <= N items( col_names ), i++,
list_item = ":" || list_item;
Insert Into( col_list, list_item );
);
dt << Ungroup Scripts( col_list ); // example usageAnother example would be usage of this list into something like:
Fit Model( Y( col_list ) ....
What I get: { "ColA", "ColB" }
What I want: { :ColA, :ColB }
I've browsed and found multiple related threads about this, but the usage of the column names as an input for a function is something I didn't stumble across. Any advice?