If you use Subset with By, you will get a list of tables which you can then loop over
dt1 = {DataTable("Sex_Subset=F"), DataTable("Sex_Subset=M")};
Edit:
Check scripting index for your functions and messages you are using, some of them are incorrect
Names Default To Here(1);
pathppt = "$TEMP/bigclass.pptx";
dt = Open("$SAMPLE_DATA/Big Class.jmp");
Column(dt, "Sex") << Set Name("Sex_Subset");
dt << New Column("Sex", Formula(:Sex_Subset));
dt_subsets = dt << Subset(By(:Sex_Subset), All rows, Selected columns only(0));
For Each({dt_subset}, dt_subsets,
subset_tab = dt_subset << Tabulate(
Add Table(
Column Table(Grouping Columns(:Sex), Analysis Columns(:height)),
Row Table(Grouping Columns(:name, :age))
)
);
tab_pic = subset_tab << get picture;
subset_tab << Close Window;
name_dt = dt_subset << get name;
Close(, no save);
hbppt = H List Box(tab_pic) << get picture;
ppt = Outline Box(name_dt, hbppt);
If(!File Exists(pathppt),
ppt << savepresentation(pathppt);
, // append only if file already exists
ppt << savepresentation(pathppt, append);
);
);
Open(pathppt);
-Jarmo