Deleting "Where" text box with JSLHi,
While running script with "where" function, a text box is added to report.
What is the way to delete it?
Is there some way to "not create" it instead of delete it? Because if I run Data Filter changes, the text box may come back.
Thanks,
Tom.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Distribution(Continuous Distribution(Column( :height )),Where( :sex == "F" ));
Re: Deleting "Where" text box with JSLThanks Mark,
I do want "where" in the Distribution, but I dont want the text box to appear.Re: Deleting "Where" text box with JSLThe script from @txnelson works for me in JMP 14 and JMP 15 and the text does not come back on a data filter change. I would suggest one change, however. Whenever possible, avoid deleting things from a JMP-created report and opt to hide them instead:
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dist = dt << Distribution( Continuous Distribution( Column( :height ) ), Where( :sex == "F" ) );
dist rep = dist << Report;
(dist rep<<TOPPARENT></TOPPARENT>
JMP platforms might make assumptions about the structure of the report when options are changed and content needs to be added or removed from the report. JMP 15 is more tolerant of content being removed, but in JMP 14 and earlier deleting the content could result in instability.
Re: Deleting "Where" text box with JSLThe direction that @Mark_Bailey pointed you is correct. However there is one tricky issue that needs to be exposed to get what you want properly handled.
The Where( :Sex == "F" ) text box is not below the Dist Report structure. Therefore,
dist rep = dist << Report;
dist rep(TextBox(1) << delete;
will not point to Where( :Sex == "F" )
One needs to move to the DisplayBox[HeadBox] which sits above the Report structure in the Display Tree to be able to access TextBox(1).
Below is the syntax of the JSL to accomplish what is needed
dist = dt << Distribution( Continuous Distribution( Column( :height ) ), Where( :sex == "F" ) );
dist rep = dist << Report;
(dist rep<<TOPPARENT></TOPPARENT>
Another way to access Where( :sex == "F" ) is to access it from the actual window reference
window("Big Class Where(sex == -F-) - Distribution")[textbox(1)]<<DELETE></DELETE>Re: Deleting "Where" text box with JSLYes, if you save a reference to the platform:
dist = dt << Distribution( Continuous Distribution( Column( :height ) ), Where( :sex == "F" ) );
dist rep = dist << Report;
dist rep[Text Box( 1 )] << Delete;
I am not sure about the proper index, but you get the idea.
I'm curious: since this script is yours, why include the Where() argument to the launch if you con't want it? The Data Filter and Local Data Filter ds not add this text box to the report display tree.