Choose Language Hide Translation Bar
Highlighted
DopeAgonist
Level III

Application with Multiple Data Table and will not create local data filters correctly

Hello all, I am trying to make an application that references multiple data tables, and within that application there are data filters that apply to graphs from each data table. When I insert the local data filter, the column options are correct. However, when I run the application all of the local data filters will reference whichever data table I had open last. Both say they are referencing the correct data table in application builder, but this somehow gets changed during the launch of the application.

For example, using two sample datasets:

JMP App(
	Set Name( "Application" ),
	Set Description(
		"An empty workspace for creating custom applications with one or more windows and scripts"
	),
	Auto Launch( 1 ),
	Snap To Grid( 1 ),
	Show Grid( 1 ),
	Show Properties( 1 ),
	Show Sources( 1 ),
	Group By Category( 1 ),
	Dashboard Mode( 0 ),
	Parameters,
	Tables(
		DataTable1 = GuiTable(
			Set Path( "$SAMPLE_DATA/Body Fat.jmp" ),
			Set Label( "Body Fat" ),
			Set Location( "Full Path" ),
			Set Invisible( 0 )
		),
		DataTable2 = GuiTable(
			Set Path( "$SAMPLE_DATA/Body Measurements.jmp" ),
			Set Label( "Body Measurements" ),
			Set Location( "Full Path" ),
			Set Invisible( 0 )
		)
	),
	Script(JSL Quote(// This script is executed when the application is run.
// Named objects have been created for the application modules
// (for example, "Module1") and the pre-defined object
// "thisApplication" refers to the application object itself.
// Variables and functions declared here are scoped to the
// Application namespace.

)	),
	Allocate(
		Module1 = Plan(
			PreAllocate,
			Script(JSL Quote(// This script is executed when a new module instance is
// created.  The pre-defined object "thisModuleInstance" refers
// to the instance object, but other objects such as boxes and
// scripts have not yet been created.  Variables declared here are
// scoped to the ModuleInstance namespace.

// This special function will receive parameters passed to CreateInstance()
OnModuleLoad({},
);

thisModuleInstance << Create Objects;

// After this point your module instance objects have been created
// and can be referred to by name (for example, "Button1").

)			),
			Allocate(
				List1 = V List Box();
				Splitter1 = H Splitter Box();
				DataFilter1 = DataTable1 << Data Filter( Local );
				Report3 = Platform(
					DataTable1,
					Bivariate(
						Y( :Name( "Height (inches)" ) ),
						X( :Name( "Weight (lbs)" ) )
					)
				);
				Splitter2 = H Splitter Box();
				DataFilter2 = DataTable2 << Data Filter( Local );
				Report2 = Platform(
					DataTable2,
					Bivariate( Y( :Head ), X( :Mass ) )
				);
			),
			Organize(
				Reparent( Splitter2( Report2 ) );
				Reparent( Splitter2( DataFilter2 ) );
				Reparent( List1( Splitter2 ) );
				Reparent( Splitter1( Report3 ) );
				Reparent( Splitter1( DataFilter1 ) );
				Reparent( List1( Splitter1 ) );
				Relocate( List1( 160, 160 ) );
			),
			Initialize(
				List1 << Background Color( 2147483647 );
				List1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} );
				List1 << Enabled( 1 );
				List1 << Horizontal Alignment( "Default" );
				List1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} );
				List1 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} );
				List1 << Text Color( 2147483647 );
				List1 << Vertical Alignment( "Default" );
				List1 << Visibility( "Visible" );
				List1 << set horizontal( 0 );
				Splitter1 << Background Color( 2147483647 );
				Splitter1 << Border(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				);
				Splitter1 << Enabled( 1 );
				Splitter1 << Horizontal Alignment( "Default" );
				Splitter1 << Margin(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				);
				Splitter1 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				);
				Splitter1 << Text Color( 2147483647 );
				Splitter1 << Vertical Alignment( "Default" );
				Splitter1 << Visibility( "Visible" );
				Splitter1 << Dockable( 0 );
				Splitter1 << Set Width( 835 );
				Splitter1 << Set Height( 497 );
				Splitter1 << Set Sizes( {0.5, 0.5} );
				Splitter1 << set horizontal( 1 );
				Splitter1 << Set Min Size( 835, 497 );
				Splitter1 << Set Max Size( 835, 497 );
				Splitter1 << Set Auto Stretching( 1, 1 );
				Splitter2 << Background Color( 2147483647 );
				Splitter2 << Border(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				);
				Splitter2 << Enabled( 1 );
				Splitter2 << Horizontal Alignment( "Default" );
				Splitter2 << Margin(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				);
				Splitter2 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				);
				Splitter2 << Text Color( 2147483647 );
				Splitter2 << Vertical Alignment( "Default" );
				Splitter2 << Visibility( "Visible" );
				Splitter2 << Dockable( 0 );
				Splitter2 << Set Width( 648 );
				Splitter2 << Set Height( 338 );
				Splitter2 << Set Sizes( {0.5, 0.5} );
				Splitter2 << set horizontal( 1 );
				Splitter2 << Set Min Size( 648, 338 );
				Splitter2 << Set Max Size( 648, 338 );
				Splitter2 << Set Auto Stretching( 1, 1 );
			)
		)
	),
	Initialize(
		Module1 << Auto Launch( 1 );
		Module1 << Set Module Type( "Report" );
		Module1 << Set Window Title( "^TABLENAME - ^APPNAME" );
		Module1 << Set Min Size( 0, 0 );
		Module1 << Set Max Size( 30000, 30000 );
		Module1 << Set Auto Stretching( ., . );
	)
) << Edit
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Byron_JMP
Staff

Re: Application with Multiple Data Table and will not create local data filters correctly

Hello,

I could replicate what you were seeing. Although this is just a work around, try this:

 

1. From your script you supplied. Change the very last line to say Run rather than Edit, and try running the script. In my hands, your script does what I'd expect it to do. 

2. When you build the application change the location of the data table to Name, rather than current data table.

	Tables(
		DataTable1 = GuiTable(
			Set Path( "$SAMPLE_DATA/Body Fat.jmp" ),
			Set Label( "Body Fat" ),
			Set Location( "name" ),
			Set Invisible( 0 )
		),
		DataTable2 = GuiTable(
			Set Path( "$SAMPLE_DATA/Body Measurements.jmp" ),
			Set Label( "Body Measurements" ),
			Set Location( "name" ),
			Set Invisible( 0 )
		)
	),

Screen Shot 2018-02-27 at 9.30.22 AM.pngThe Location option is down at the bottom.

 

Sometimes the "allocation" pointer is not as expected. So, in the script, double check that filter 1 points to table 1 and filter 2 points to table 2.

Allocate(
				List1 = V List Box();
				Splitter1 = H Splitter Box();
				DataFilter1 = DataTable1 << Data Filter( Local );
				Report3 = Platform(
					DataTable1,
					Bivariate(
						Y( :Name( "Height (inches)" ) ),
						X( :Name( "Weight (lbs)" ) )
					)
				);
JMP Systems Engineer, Pharm and BioPharm Sciences

View solution in original post

5 REPLIES 5
Highlighted
cwillden
Super User

Re: Application with Multiple Data Table and will not create local data filters correctly

 Hi @DopeAgonist,

This is pretty strange behavior, and it probably deserves the attention of the a developer.  I verified what you described building the application from scratch, and also changing the local data filter association in the script to the correct table.  I was able to get the appropriate data filters to appear by adding them manually in the script using 

Splitter1 << Prepend(DataTable1 << Data Filter("Local"));
Splitter2 << Prepend(DataTable2 << Data Filter("Local"));

 But this still doesn't work.  Not matter which way you do it, the local data filters are not connected properly to the table for some reason.  Changing the values of any filters has no effect on row selection in the tables.

If you create the data filters from the analysis platforms you are pulling into your application, then the filters do work.  For example:

JMP App(
	Set Name( "Application" ),
	Set Description(
		"An empty workspace for creating custom applications with one or more windows and scripts"
	),
	Auto Launch( 1 ),
	Snap To Grid( 1 ),
	Show Grid( 1 ),
	Show Properties( 1 ),
	Show Sources( 1 ),
	Group By Category( 1 ),
	Dashboard Mode( 0 ),
	Parameters,
	Tables(
		DataTable1 = GuiTable(
			Set Path( "$SAMPLE_DATA/Body Fat.jmp" ),
			Set Label( "Body Fat" ),
			Set Location( "Full Path" ),
			Set Invisible( 1 )
		),
		DataTable2 = GuiTable(
			Set Path( "$SAMPLE_DATA/Body Measurements.jmp" ),
			Set Label( "Body Measurements" ),
			Set Location( "Full Path" ),
			Set Invisible( 1 )
		)
	),
	Script(JSL Quote(// This script is executed when the application is run.
// Named objects have been created for the application modules
// (for example, "Module1") and the pre-defined object
// "thisApplication" refers to the application object itself.
// Variables and functions declared here are scoped to the
// Application namespace.

)	),
	Allocate(
		Module1 = Plan(
			PreAllocate,
			Script(JSL Quote(// This script is executed when a new module instance is
// created.  The pre-defined object "thisModuleInstance" refers
// to the instance object, but other objects such as boxes and
// scripts have not yet been created.  Variables declared here are
// scoped to the ModuleInstance namespace.

// This special function will receive parameters passed to CreateInstance()
OnModuleLoad({},
);

thisModuleInstance << Create Objects;

// After this point your module instance objects have been created
// and can be referred to by name (for example, "Button1").

)			),
			Allocate(
				Report2 = Platform(
					DataTable2,
					Bivariate(
						Y( :Head ),
						X( :Mass ),
						Automatic Recalc( 1 ),
						Local Data Filter
					)
				);
				Report1 = Platform(
					DataTable1,
					Bivariate(
						Y( :Name( "Height (inches)" ) ),
						X( :Name( "Weight (lbs)" ) ),
						Automatic Recalc( 1 ),
						Local Data Filter
					)
				);
			),
			Organize(
				Relocate( Report1( 0, 0 ) );
				Relocate( Report2( 10, 680 ) );
			),
			Initialize( Glue() )
		)
	),
	Initialize(
		Module1 << Auto Launch( 1 );
		Module1 << Set Module Type( "Report" );
		Module1 << Set Window Title( "^TABLENAME - ^APPNAME" );
		Module1 << Set Min Size( 0, 0 );
		Module1 << Set Max Size( 30000, 30000 );
		Module1 << Set Auto Stretching( ., . );
	)
) << Edit

Granted this doesn't look exactly the way you had it, but maybe it will work well enough for you.

-- Cameron Willden
Highlighted
DopeAgonist
Level III

Re: Application with Multiple Data Table and will not create local data filters correctly

Hello Cameron, thanks for your reply. That's actually how I originally had it, but that creates its own set of problems. Elsewhere in the application I have scripted setting to apply to these filters (of which there are over a dozen in my actual application). I couldn't figure out how to access the filter with scripting when it was included as part of the platform. Basically I couldn't figure out how to script commands to my platforms, only the display items for them. This is a separate issue, but if you happen to know how to resolve this it would be helpful as well!

Highlighted
Byron_JMP
Staff

Re: Application with Multiple Data Table and will not create local data filters correctly

Hello,

I could replicate what you were seeing. Although this is just a work around, try this:

 

1. From your script you supplied. Change the very last line to say Run rather than Edit, and try running the script. In my hands, your script does what I'd expect it to do. 

2. When you build the application change the location of the data table to Name, rather than current data table.

	Tables(
		DataTable1 = GuiTable(
			Set Path( "$SAMPLE_DATA/Body Fat.jmp" ),
			Set Label( "Body Fat" ),
			Set Location( "name" ),
			Set Invisible( 0 )
		),
		DataTable2 = GuiTable(
			Set Path( "$SAMPLE_DATA/Body Measurements.jmp" ),
			Set Label( "Body Measurements" ),
			Set Location( "name" ),
			Set Invisible( 0 )
		)
	),

Screen Shot 2018-02-27 at 9.30.22 AM.pngThe Location option is down at the bottom.

 

Sometimes the "allocation" pointer is not as expected. So, in the script, double check that filter 1 points to table 1 and filter 2 points to table 2.

Allocate(
				List1 = V List Box();
				Splitter1 = H Splitter Box();
				DataFilter1 = DataTable1 << Data Filter( Local );
				Report3 = Platform(
					DataTable1,
					Bivariate(
						Y( :Name( "Height (inches)" ) ),
						X( :Name( "Weight (lbs)" ) )
					)
				);
JMP Systems Engineer, Pharm and BioPharm Sciences

View solution in original post

Highlighted
DopeAgonist
Level III

Re: Application with Multiple Data Table and will not create local data filters correctly

This worked!! Thank you so much! I was at a dead end on finding a workaround, mostly because I thought I couldn't see the script that was creating the application anymore. When my application got large enough (60+ platforms with 28+ local data filters and the display elements to hold them all) the "save script" option seemed to just be giving me the custom script portion of my application. It turns out it was just putting all of the Allocate function onto one line. When I hit reformat script it revealed the hundreds of additional lines. This isn't necessarily a bug I guess, but I thought you might want to be aware of it.

 

When I followed the steps you suggested everything is working properly. I hope this gets fixed in future iterations though, as I will need to create the whole application before going back to the script to edit the filters to be correct.

Highlighted
Jeff_Perkinson
Community Manager Community Manager

Re: Application with Multiple Data Table and will not create local data filters correctly

I can confirm that this issue will be addressed with JMP 15.2 and beyond. Multiple local data filters in an application will maintain their connection to the appropriate data table.

-Jeff
Article Labels

    There are no labels assigned to this post.