Local data Filter Lost in Platform ScriptHi,
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.
Re: Local data Filter Lost in Platform ScriptThanks Craige_Hales. This worked.
txnelson's solution also worked if I added
Wait( 0.1 );
bv << Journal;
Re: Local data Filter Lost in Platform Scriptadd
bv<<UPDATEWINDOW></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.
Re: Local data Filter Lost in Platform ScriptThanks, 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.
Re: Local data Filter Lost in Platform ScriptI 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.