cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

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

Non-communicative data filter after sorting rows

I have a window with a dynamic data filter. The filter is used to distill a table down before going to an external python function for post processing. The filter dynamically updates well when deleting rows. However, if I sort the rows in my data table by certain column values it seems like the table is disconnected /non-communicative with the window since changing the filter no longer triggers a python call. Even if I undo the sorting it still persists. I have a feeling that this is due to the fact that sorting function replaces the current data table and it may be necessary to somehow resync the filter.

 

dt = Current Data Table();

// Python execution function
run_python_func = Function( { dt },
	Python Send( dt );
	Python Execute(
		{ },
		{ output },
		"\[
import jmp

# Do some stuff
output = 4 + 4 ]\" );
Show( output ); ); plot_window = New Window( "Python post process", Data Filter Context Box( H List Box( cb = Check Box( "Enable real-time filtering" ), filter = (dt << Data Filter( Local, Add Filter( columns( :DIE_ID, :MACRO, :TEST_NAME ) ) ) ) ) ) ) ); // Do real-time filtering refresh_filter = Function( { do_filt }, If( do_filt, // Get selected rows and filter input data table rows = filter << get filtered rows; dt_filt = dt << Subset( Rows(rows), selected columns(0) ); dt_filt << Show Window(0); // Run python function run_python_func( dt_filt ); Close( dt_filt, NoSave); ); ); rs = filter << Make Filter Change Handler( refresh_filter( cb << Get() ) );

 

 

2 REPLIES 2
jthi
Super User

Re: Non-communicative data filter after sorting rows

Data filter will get "disconnected" from the table. If you just create a global data filter to a table and then try to sort it, JMP will give you following message

jthi_0-1767769796710.png

Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");

plot_window = New Window("Python post process",
	Data Filter Context Box(
		H List Box(
			cb = Check Box("Enable real-time filtering"), 
			filter = (dt << Data Filter(Global, Add Filter(columns(:age, :sex, :name))))
		)
	)
);

// Do real-time filtering
refresh_filter = Function({do_filt},
	show(Today());
);

rs = filter << Make Filter Change Handler(refresh_filter(cb << Get()));

Write();

There might be some ways around this, but implementation will depend on your use case.

-Jarmo
hogi
Level XIII

Re: Non-communicative data filter after sorting rows

Deleting rows works fine, but many other changes to the data table aren’t allowed when reports are open or when a linked subset exists. To be honest, this is quite unexpected for JMP "19" — it feels like 199x.

JMP is already powerful—but being able to freely modify a data table even when reports or linked subsets exist would be a huge productivity boost.

In particular:

  • sorting the data table
  • adding rows
  • concatenating tables

should be possible without forcing the user to manually tear down the analysis context:Sort data table + add rows + concatenate -- make it possible 

If you’re running into the same problem, just follow the link and support the wish with a Kudo *)
 

At the very least, JMP should:

  • Make dependencies transparent
    • What exactly is blocking the operation?
    • Which report, subset, or data filter holds the lock?
  • Provide a clear way to apply the requested change
    • e.g., by offering to close and re-open the affected report(s) or subset(s) automatically

 




*) NB: Unfortunately, the Kudos here don't affect the status of the wish.
hogi_0-1767819506685.png

Recommended Articles