BookmarkSubscribe
Choose Language Hide Translation Bar
Leo_Huang
Community Trekker

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(.....);
)
)
);

 

0 Kudos
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
4 REPLIES 4
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
Community Trekker

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 ) ))),

 

 

0 Kudos
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
Community Trekker

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

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

0 Kudos