Thank you for pointing out the Srcipting index, it is really helpful.
A further question: does the "list of the worksheet names" have to be strings? Can they be string variables?
Here is an example I am struggling with:
The script below creates three datatables based on :Column 2 values, then save three separate sheets in one Excel files. I would like to name each worksheet based on :Column 2 values, but when I put GroupBy variable as the worksheet names (the red script below), it does not assign :Column 2 value to each worksheet.
dt = current datatable();
Summarize (dt, GroupBy = By (:Column 2) );
For ( i=1, i<= N items (GroupBy), i++,
dt<< select where (:Column 2 == GroupBy [i]);
dt2= dt << subset (
Selected Rows( 1 ),
Selected columns only( 0 )
);
show (dt2);
show (GroupBy[i]);
Create Excel Workbook ("$DESKTOP/Untitled1.xlsx", {dt2}, GroupBy[i]);
);
Thank you for your help!