BookmarkSubscribe
Choose Language Hide Translation Bar
vishwasanj
Community Trekker

Tabulate function FOR loop

Hi All,

 

I have a data table and I want to run a loop to get all the columns and place it in the tabulate function. Basically it has column name as 1,2,3,4,5...and the contents are random PASS or FAIL.

 

I came across this blogpost which was useful (https://community.jmp.com/t5/Discussions/How-do-I-have-tabulate-iterate-through-multiple-columns-usi...) but instead of having by grouping columns, is it possible to have a simple table having column names(1,2,3,4...) as the first column and % total of each column with fail/pass next to it.

 

Here is the code I used:

 

col_list = current data table()<<get column names(string);
Show(col_list);
tab = current data table()<<Tabulate(Add Table( Column Table( Statistics( Name( "% of Total" ) ) )));
// Add grouping columns in cList/

For (c=1, c<=NItems(col_list), c++,
tab << Add table(Row Table( Grouping Columns( col_list[c] ) ));
);

 

 

Attached is a picture which shows that the left table is the one I get, the right table is what I want. Thank you.

0 Kudos
1 REPLY 1
uday_guntupalli
Community Trekker

Re: Tabulate function FOR loop

@vishwasanj,
Can you upload some sample data ?
Best
Uday