cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
hogi
Level XII

Data Filter - and some more data points?

Hi,

 

I want to use a Data filter in a Dashboard to restrict a Graph builder Plot. 

But in addition to the selected data, I want to show some reference data.

Let's say, the filter is used to select a child from Big Class - and in addition, the Graph builder plot should always show the data of all boys in the class.

Is this possible with standard dashboard - or do I have to use JSL to atomate the selection of the respective rows?

 

In this illustration the Local Data Filter on the Left should just control the data filter part of the GraphBuilder starting from OR (:sex = =M should be plotted in addition.)

 

Local Here(
	table1 = Open( "C:\Program Files\SAS\JMP\17\Samples\Data\Big Class.jmp" );
	New Window( "Big Class - Dashboard",
		Data Filter Context Box(
			Tab Page Box(
				"Dashboard",
				H Splitter Box(
					Size( 1041, 616 ),
					<<Sizes( {0.204739336492891, 0.795260663507109} ),
					Tab Page Box(
						"Local Data Filter",
						Scroll Box(
							Size( 213, 587 ),
							Flexible( 1 ),
							table1 << Data Filter(
								Local,
								Add Filter(
									columns( :name ),
									Where( :name == "BARBARA" ),
									Display(
										:name,
										N Items( 15 ),
										Find( Set Text( "" ) )
									)
								)
							)
						)
					),
					Tab Page Box(
						"Graph Builder",
						Scroll Box(
							Size( 825, 587 ),
							Flexible( 1 ),
							V List Box(
								table1 <<
								Graph Builder(
									Size( 513, 567 ),
									Show Control Panel( 0 ),
									Summary Statistic( "Median" ),
									Graph Spacing( 4 ),
									Variables(
										X( :height ),
										Y( :weight ),
										Color( :sex )
									),
									Elements(
										Points( X, Y, Legend( 19 ) ),
										Smoother( X, Y, Legend( 20 ) )
									),
									Local Data Filter(
										Add Filter(
											columns( :sex ),
											Where( :sex == "M" )
										), // OR: 
										Add Filter(
											columns( :name ),
											Display(
												:name,
												N Items( 15 ),
												Find( Set Text( "" ) )
											)
										)
									)
								)
							)
						)
					)
				)
			)
		)
	)
)
1 ACCEPTED SOLUTION

Accepted Solutions
ih
Super User (Alumni) ih
Super User (Alumni)

Re: Data Filter - and some more data points?

Hi @hogi, I think you can do this with just an OR condition in the local data filter:

 

ih_0-1688409705441.png

 

View more...
Local Here(
	
	dt = Open( "$Sample_data/big class.jmp" );

	gb = dt << Graph Builder(
	
		//A new column with only the names that the user can select
		Transform Column(
			"Female Name",
			Nominal,
			Formula( If( :sex == "F", :name, "" ) )
		),
		Size( 534, 518 ),
		Show Control Panel( 0 ),
		Variables( X( :height ), Y( :weight ), Overlay( :sex ), Color( :sex ) ),
		Elements( Points( X, Y, Legend( 23 ) ) ),
		Local Data Filter(
			Add Filter(
				columns( :Female Name ),
				Where( :Female Name == "KATIE" ),
				Display( :Female Name, N Items( 15 ) )
			),
			//This is the OR condition that was added interactively
			Add Filter( columns( :sex ), Where( :sex == "M" ) )
		)
	);
	
	//Format points to highlight the selected name over the reference data.
	//Copied and pasted the 'send to report' section into this.
	(gb << xpath("//ScaleBox[@ID='400']")) << Legend Model(
		23,
		Properties(
			0,
			{Line Color( 5 ), Marker( "FilledCircle" ), Marker Size( 6 )},
			Item ID( "F", 1 )
		),
		Properties(
			1,
			{Line Color( 1 ), Marker( "Dot" ), Marker Size( 2 )},
			Item ID( "M", 1 )
		)
	);
	
);

View solution in original post

2 REPLIES 2
ih
Super User (Alumni) ih
Super User (Alumni)

Re: Data Filter - and some more data points?

Hi @hogi, I think you can do this with just an OR condition in the local data filter:

 

ih_0-1688409705441.png

 

View more...
Local Here(
	
	dt = Open( "$Sample_data/big class.jmp" );

	gb = dt << Graph Builder(
	
		//A new column with only the names that the user can select
		Transform Column(
			"Female Name",
			Nominal,
			Formula( If( :sex == "F", :name, "" ) )
		),
		Size( 534, 518 ),
		Show Control Panel( 0 ),
		Variables( X( :height ), Y( :weight ), Overlay( :sex ), Color( :sex ) ),
		Elements( Points( X, Y, Legend( 23 ) ) ),
		Local Data Filter(
			Add Filter(
				columns( :Female Name ),
				Where( :Female Name == "KATIE" ),
				Display( :Female Name, N Items( 15 ) )
			),
			//This is the OR condition that was added interactively
			Add Filter( columns( :sex ), Where( :sex == "M" ) )
		)
	);
	
	//Format points to highlight the selected name over the reference data.
	//Copied and pasted the 'send to report' section into this.
	(gb << xpath("//ScaleBox[@ID='400']")) << Legend Model(
		23,
		Properties(
			0,
			{Line Color( 5 ), Marker( "FilledCircle" ), Marker Size( 6 )},
			Item ID( "F", 1 )
		),
		Properties(
			1,
			{Line Color( 1 ), Marker( "Dot" ), Marker Size( 2 )},
			Item ID( "M", 1 )
		)
	);
	
);
hogi
Level XII

Re: Data Filter - and some more data points?

Thanks.

Hm, you are right - forget about the Local Data Filter - put the OR inside the Data Filter(Local ...