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
Leo_Huang
Level I

data filter for several graph from a same data table

 

I want to plot several graphs with the same data source in a same window.Here I put a data filter before the plotting.But it dosen't work.Could anyone help??!

dt= Open( "$SAMPLE_DATA/Big Class.jmp" );
 
New Windows("mt report",
  nwBB = Border box(
 
 dt<< Data Filter(
   Add Filter( columns( :group ), Where( :group == 1 ) )
);
 
 
V List Box(
Graph Builder(.....);
Graph Builder(.....);
)
)
);

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: data filter for several graph from a same data table

See the script below for the proper ordering of the elements to make the script work

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
 
New Window( "mt report",
	nwBB = Border Box(
		V List Box(
			dt << Data Filter( Add Filter( columns( :group ), Where( :group == 1 ) ) ),
			dt << Graph Builder(
				Size( 528, 454 ),
				Show Control Panel( 0 ),
				Variables( X( :weight ), Y( :height ) ),
				Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
			),
			dt << Graph Builder(
				Size( 528, 454 ),
				Show Control Panel( 0 ),
				Variables( X( :height ), Y( :weight ) ),
				Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
			)
		)
	)
);
Jim

View solution in original post

5 REPLIES 5
pmroz
Super User

Re: data filter for several graph from a same data table

Try something like this:

dt = open("$sample_data\Big Class.jmp");

nw = new window("Test 2 Graphs + Data Filter",
	vlistbox(
		dt << Graph Builder(
			Size( 518, 445 ),
			Show Control Panel( 0 ),
			Variables( X( :age ), Y( :sex ), Overlay( :sex ) ),
			Elements( Points( X, Y, Legend( 9 ) ) ),
			Local Data Filter( Add Filter( columns( :height ) ) )
		),
		dt << Graph Builder(
			Size( 526, 451 ),
			Show Control Panel( 0 ),
			Variables( X( :weight ), Y( :height ) ),
			Elements( Points( X, Y, Legend( 5 ) ), Smoother( X, Y, Legend( 6 ) ) ),
			Local Data Filter( Add Filter( columns( :sex ) ) )
		),
	)
);

 LDFGBx2.png

Leo_Huang
Level I

Re: data filter for several graph from a same data table

So if I want to get the plot with column(group) value=1,I have to code like this??

Elements(...)
Local Data Filter(Add Filter( columns( :group ), Where( :group == 1 ) ))),

 

 

txnelson
Super User

Re: data filter for several graph from a same data table

See the script below for the proper ordering of the elements to make the script work

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
 
New Window( "mt report",
	nwBB = Border Box(
		V List Box(
			dt << Data Filter( Add Filter( columns( :group ), Where( :group == 1 ) ) ),
			dt << Graph Builder(
				Size( 528, 454 ),
				Show Control Panel( 0 ),
				Variables( X( :weight ), Y( :height ) ),
				Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
			),
			dt << Graph Builder(
				Size( 528, 454 ),
				Show Control Panel( 0 ),
				Variables( X( :height ), Y( :weight ) ),
				Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
			)
		)
	)
);
Jim
Leo_Huang
Level I

Re: data filter for several graph from a same data table

Big thx!! I'll try it tomorrow in company!

Sburel
Level IV

Re: data filter for several graph from a same data table

Hello,

 

It seems that in JMP16, this script would not have the data filter included in the report (as was the case for JMP15) but rather in its own data filter window.

 

Any suggestions to get a result similar to JMP 15?

 

Best,

 

Sebastien