We’re asking you to select a content label when starting a new topic in the Discussions area. Read more to find out why.
Choose Language Hide Translation Bar
robot
Level VI

Local data Filter Lost in Platform Script

Hi,

If I script a graph with a local data filter, I can save the results to a jounal.  But if I do the same thing using Platform(), the filter is not applied.  Why is this?  Is there a good way to script results to a journal without having new windows created?  I am using JMP12.2.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

bv = dt << Bivariate(
	Y( :height ),
	X( :weight ),
	Automatic Recalc( 1 ),
	Local Data Filter( Add Filter( columns( :sex ), Where( :sex == "M" ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Bivar Plot",
			FrameBox,
			{Row Legend(
				sex,
				Color( 1 ),
				Color Theme( "JMP Default" ),
				Marker( 1 ),
				Marker Theme( "Solid" ),
				Continuous Scale( 0 ),
				Reverse Scale( 0 ),
				Excluded Rows( 0 )
			)}
		)
	)
);

bv << Journal; // Local data filter is applied.

bv2 = Platform(
	dt,
	Bivariate(
		Y( :height ),
		X( :weight ),
		Automatic Recalc( 1 ),
		Local Data Filter( Add Filter( columns( :sex ), Where( :sex == "M" ) ) ),
		SendToReport(
			Dispatch(
				{},
				"Bivar Plot",
				FrameBox,
				{Row Legend(
					sex,
					Color( 1 ),
					Color Theme( "JMP Default" ),
					Marker( 1 ),
					Marker Theme( "Solid" ),
					Continuous Scale( 0 ),
					Reverse Scale( 0 ),
					Excluded Rows( 0 )
				)}
			)
		)
	)
);

bv2 << Journal; // Local data filter is not applied.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Craige_Hales
Staff (Retired)

Re: Local data Filter Lost in Platform Script

add

bv<<updatewindow;

before the << journal. The Data Filter (and Column Switcher) depend on being updated in a window; the invisible window needs the update too if you run all the statements at once. The platform function doesn't build the window, so the update never happens. There appear to be some other issues there as well. Thanks for pointing this out. I'm adding some notes to the list of things to work on.

Craige

View solution in original post

4 REPLIES 4
Highlighted
txnelson
Super User

Re: Local data Filter Lost in Platform Script

I would assume the issue you are running into is that by the definition of the Platform() function, it is assumed to be called within a defined window.

To answer your question about creating an object without a display window and copying it to a journal:  If what you are attempting to do is to avoid a window popping up before the journal is created, all you have to do is to add the "Invisible" element to the platform invocation.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

bv = dt << Bivariate(invisible,
	Y( :height ),
	X( :weight ),
	Automatic Recalc( 1 ),
	Local Data Filter( Add Filter( columns( :sex ), Where( :sex == "M" ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Bivar Plot",
			FrameBox,
			{Row Legend(
				sex,
				Color( 1 ),
				Color Theme( "JMP Default" ),
				Marker( 1 ),
				Marker Theme( "Solid" ),
				Continuous Scale( 0 ),
				Reverse Scale( 0 ),
				Excluded Rows( 0 )
			)}
		)
	)
);

bv << Journal; // Local data filter is applied.

 

Jim
Highlighted
robot
Level VI

Re: Local data Filter Lost in Platform Script

Thanks, txnelson.  Did you test your script on JMP12.2?  When I run your code, I still get the journal output without the applied local data filter.

Highlighted
Craige_Hales
Staff (Retired)

Re: Local data Filter Lost in Platform Script

add

bv<<updatewindow;

before the << journal. The Data Filter (and Column Switcher) depend on being updated in a window; the invisible window needs the update too if you run all the statements at once. The platform function doesn't build the window, so the update never happens. There appear to be some other issues there as well. Thanks for pointing this out. I'm adding some notes to the list of things to work on.

Craige

View solution in original post

Highlighted
robot
Level VI

Re: Local data Filter Lost in Platform Script

Thanks Craige_Hales.  This worked.

 

txnelson's solution also worked if I added

Wait( 0.1 );
bv << Journal;