cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • See how to use the JMP Marketplace – Free tools to expand JMP capabilities. Register. July 10, 2 pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar

Convert tab headers in tabulate to column groups JMP19

Hello,

 

In JMP19 there is very nice new functionality where grouping columns create column headers in the data table.

Thus, we wanted to know if when we do a tabulate , and we do "Make into data table" , can we keep the headers ?

I know we can keep the headers as tags, but otherwise can I transform the tags to group columns?

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Car Poll.jmp" );
obj = dt << Tabulate(
	Add Table(
		Column Table( Grouping Columns( :sex, :marital status ) ),
		Row Table( Grouping Columns( :country, :size ) )
	)
);

tbl = obj << make into data table();
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Convert tab headers in tabulate to column groups JMP19

You could build them from column properties (there definitely should be << Get Tags or something similar)

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Car Poll.jmp");
tab = dt << Tabulate(
	Add Table(
		Column Table(Grouping Columns(:sex, :marital status)),
		Row Table(Grouping Columns(:country, :size))
	)
);

dt_tab = tab << make into data table;

tags = {};
For Each({colname}, dt_tab << Get Column Names("String"),
	prop = Column(dt_tab, colname) << Get Property("Tags");
	If(!Is Empty(prop),
		Insert Into(tags, prop);	
	);
);

And build it from there while taking into account the hierarchy of the groups.

Other option could be to utilize Full Path Column Name(1) but it does affect the column names (and tags)

jthi_0-1765896185094.png

 

-Jarmo

View solution in original post

4 REPLIES 4
jthi
Super User

Re: Convert tab headers in tabulate to column groups JMP19

I don't think you can do it without scripting, but you could make a wish list item?

-Jarmo

Re: Convert tab headers in tabulate to column groups JMP19

But do it in scripting it suits me also, but I didn't get a JSL command to retrieve the list of all current tags in the table or something else to achieve the result I wanted

jthi
Super User

Re: Convert tab headers in tabulate to column groups JMP19

You could build them from column properties (there definitely should be << Get Tags or something similar)

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Car Poll.jmp");
tab = dt << Tabulate(
	Add Table(
		Column Table(Grouping Columns(:sex, :marital status)),
		Row Table(Grouping Columns(:country, :size))
	)
);

dt_tab = tab << make into data table;

tags = {};
For Each({colname}, dt_tab << Get Column Names("String"),
	prop = Column(dt_tab, colname) << Get Property("Tags");
	If(!Is Empty(prop),
		Insert Into(tags, prop);	
	);
);

And build it from there while taking into account the hierarchy of the groups.

Other option could be to utilize Full Path Column Name(1) but it does affect the column names (and tags)

jthi_0-1765896185094.png

 

-Jarmo

Re: Convert tab headers in tabulate to column groups JMP19

Thank you I will do that and add in the wishlist

Recommended Articles