I was writing a script to stack bunch of columns togthers using JSL script like below. However, I am keeps getting error message that "Number of series should be a positive integer". I need the N to be variable depending on how many columns need to be stacked for different tables. I have other script to identify the number of column which works perfectly fine. Just the stack function somehow does not work.
dt_join2=current data table();
N=49
Data Table( dt_join2 ) << Stack(
columns(Lstcols ),
Source Label Column( lstCols3 ),
Stacked Data Column( lstCols2 ),
Number of Series(N)
);