Hello everyone!
Lets say I have a data table which looks like that:
A,B1,B2,C1,C2,D
1,2,3,4,5,16
6,7,8,9,10,16
11,12,13,14,15,16
I want to stack them so the new table looks like that:
A,B,C
1,2,4
1,3,5
6,7,9
6,8,10
11,12,14
11,13,15
I have three lists: one containing columns that need to be kept: list_to_keep= {A},list_to_stack_before= {B1,C1} and list_to_stack_after = {B2,C2}.
First i wrote a script to create a new list with the new column names:
new_column_names = {};
str = char(list_to_stack_before);
newstr = substitute(str,"", "", "_be_sam","");
new_column_names = parse(newstr);
Then I tried to loop the stack function but it always just adds more rows. I can not use the normal Stack function because it doesnt let me use multiple names in the Stacked Data Column argument. How can I solve this problem? Thanks a lot i am very new to jmp.