I have two different data tables, A and B. There is one column from each data table has similar variable.
I create subset from each data table A and B by column that has similar variable using separate For loop to create table report and append it into one new window.
I notice that all the table reports created from subset data table A are appended into new window and followed by all the table reports from subset data table B.
What I want is to append one table report from subset data table A followed by table report from subset data table B for each variable level.
How should I write the code?
I am using Big Class and Big Class Families data set as an example to illustrate this.
dt1 = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt2 = Open( "$SAMPLE_DATA/Big Class Families.jmp" );
vb = V List Box();
listdt1 = {};
listdt2 = {};
coldt1 = Column (dt1, "age");
coldt2 = Column (dt2, "age");
colleveldt1 = Associative Array(coldt1) << Get Keys;
colleveldt2 = Associative Array(coldt1) << Get Keys;
For (i=1, i <=N Items(colleveldt1), i++,
dt1row = dt1 << Get Rows Where(:age == colleveldt1[i]);
listdt1[i] = dt1 << Subset(Rows(dt1row));
tb = listdt1[i]<< Get As Report;
vb << Append (Table Box(tb));
);
For (i=1, i <=N Items(colleveldt2), i++,
dt2row = dt2 << Get Rows Where(:age == colleveldt2[i]);
listdt2[i] = dt2 << Subset(Rows(dt2row));
tb = listdt2[i]<< Get As Report;
vb << Append (Table Box(tb));
);
New Window("Report", vb);