All,
I'm trying to write a script that gets a count of observations, potentially by 1 or more columns (as determined by input from the user). I can get the script to work for one column, but not for two or more. How do I adjust the code in the by step of the summarize function to handle 1+ columns?
Below is a sample of script:
varName = VarList <<Get selected();
numCols = nitems(varName);
n = nrow(dt);
if(numCols == 0,
//do one thing
,numCols>0,
summarize(dt, cat = by(Column(dt,varName)),c=count);
//do other things
);
Thanks!
Sarah