Hello,
I have the next code. In the last lines I try to stack some columns. The problem is that when I run the script I see only 1 column stacked although I need to see more than 1(according to the lists length inside the code)
);<BR /><BR />dt = open("C:\JMPCommunity\DataTableExample.jmp");
s_list = {sen1, sen2, sen3, sen4, sen5};
test_list ={test1, test2, test3};
tokens_list={Col1, Col2, Col3};
g_list={g1,g2,g3};
For(j = 1, j<=Length(test_list), j++,
For( i = 1, i<= Length(s_list), i++,
dt << New Column ( test_list[j] ||"_" || s_list[i],
Numeric,
Continuous,
Formula(
Num(Word( i, As Column(Column(tokens_list[j] )), "|" ))
)
)
);
g_list[j] = dt << Group Columns(:( || test_list[j]|| "_" || s_list[1]), Length(s_list));<BR /> dt << Stack(columns(dt << Get Column Group( g_list[j] );),<BR /> Source Label Column( "Label_" || test_list[j] ),<BR /> Stacked Data Column( "Data_" || test_list[j])<BR /> );<BR />
My Qs are:
1. How can the issue be fixed.
2. How can the new opened data table will be a new dt (that is not updated by the original one)?
A dt example is attached