cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
UserID16644
Level V

User Input Tabulate Column

Is it possible to have a user-based column when tabulating data? I have a tabulated table but the grouping columns need to be based on the user input. I can't think of ways to do it, is it possible? pls help

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: User Input Tabulate Column

JMP has the functionality to request user input and then pass that information into whatever scripting is required.  I recommend that you take the time to read through the Scripting Guide.

Here is a very simple example to do what you want.  Far better interfaces can be developed, but this should give you a start

Names Default To Here( 1 );
// Open Data Table: big class.jmp
// → Data Table( "big class" )
dt = Open( "$SAMPLE_DATA/big class.jmp" );

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
nw = New Window( "Col List Box Example",
	Text Box( "Select the Grouping Columns" ),
	Col List Box( all, width( 250 ), maxSelected( 1 ) ),
	fontobj = lb = Col List Box( character ),
	OKbb = Button Box( "OK",
		theColumns = lb << get items;
		nw << close window;

		Tabulate(
			Show Control Panel( 0 ),
			Add Table(
				Column Table( Analysis Columns( :height, :weight ), Statistics( Mean ) ),
				Row Table( Grouping Columns( eval(theColumns) ) )
			)
		);
	)
);
Jim

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: User Input Tabulate Column

JMP has the functionality to request user input and then pass that information into whatever scripting is required.  I recommend that you take the time to read through the Scripting Guide.

Here is a very simple example to do what you want.  Far better interfaces can be developed, but this should give you a start

Names Default To Here( 1 );
// Open Data Table: big class.jmp
// → Data Table( "big class" )
dt = Open( "$SAMPLE_DATA/big class.jmp" );

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
nw = New Window( "Col List Box Example",
	Text Box( "Select the Grouping Columns" ),
	Col List Box( all, width( 250 ), maxSelected( 1 ) ),
	fontobj = lb = Col List Box( character ),
	OKbb = Button Box( "OK",
		theColumns = lb << get items;
		nw << close window;

		Tabulate(
			Show Control Panel( 0 ),
			Add Table(
				Column Table( Analysis Columns( :height, :weight ), Statistics( Mean ) ),
				Row Table( Grouping Columns( eval(theColumns) ) )
			)
		);
	)
);
Jim
UserID16644
Level V

Re: User Input Tabulate Column

Not sure if it's my JMP Version (JMP15) but it's not working for me

txnelson
Super User

Re: User Input Tabulate Column

It works fine under JMP 15, running Windows 10.

Here is the first screen

txnelson_0-1647410582870.png

I then select columns Name and Age and move them into the selection area

txnelson_1-1647410659706.png

Finally I click on OK and get the following results

txnelson_2-1647410725103.png

 

 

Jim
UserID16644
Level V

Re: User Input Tabulate Column

Worked well. Thanks!