cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
Woodrat
Level II

JSL to Close Data Filter Window

Howdy, I am trying to include in my script a line at the end that will close the data filter window once it has completed its action. The script right now will open a data filter and apply the filter I want to the target column but I can't figure out how to then get the data filter window to close. I'm not sure if it's even possible, but seems like it would be given the capabilities of JSL. I can write a line of script to close the current data table just fine, I simply can't figure out how to apply the close feature to the data filter window alone. Many thanks for any input!

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: JSL to Close Data Filter Window

Here is what I have come up with

Names Default To Here( 1 );
dt = Current Data Table();
df = dt << Data Filter;
Wait( 2 );
Window( "Data Filter for " || Char( dt << get name ) ) << Close window;

Unless you are interactively changing the Data Filter values there is probably a better way in JSL to perform the tasks.  What specifically are you using the data filter for? 

Jim

View solution in original post

5 REPLIES 5
mmarchandFSLR
Level III

Re: JSL to Close Data Filter Window

Something like this?

 

Names Default to Here( 1 );
df = Current Data Table() << Data Filter;
Wait( 2 );
( df << Get Window ) << Close;
txnelson
Super User

Re: JSL to Close Data Filter Window

Here is what I have come up with

Names Default To Here( 1 );
dt = Current Data Table();
df = dt << Data Filter;
Wait( 2 );
Window( "Data Filter for " || Char( dt << get name ) ) << Close window;

Unless you are interactively changing the Data Filter values there is probably a better way in JSL to perform the tasks.  What specifically are you using the data filter for? 

Jim
mmarchandFSLR
Level III

Re: JSL to Close Data Filter Window

I swear this didn't work when I tried it initially, but, after looking at the Scripting Index, I saw it's valid and tried again.  Probably a typo in my first attempt.

 

Names Default to Here( 1 );
df = Current Data Table() << Data Filter;
Wait( 2 );
df << Close;

 

Woodrat
Level II

Re: JSL to Close Data Filter Window

That worked a treat! Thanks for the input, I greatly appreciate it!

 

A bit of background: I'm using this script as a tool to identify CV values above a certain percentage. There are a number of folks I work with that have JMP but not the level of experience that my self (and one other whom I work with) have, so by creating a script, I can give this to them and they can quickly and easily identify assays with CV outliers. It shouldn't need to be a dynamic filter since it's filtering for a hard cutoff. I just didn't want the data filter window sticking around for anyone to edit or offer up greater confusion. Many thanks for the answer.

Re: JSL to Close Data Filter Window

You said, "The script right now will open a data filter and apply the filter I want to the target column but I can't figure out how to then get the data filter window to close." If you are using the filter to select rows, another way without using a data filter object is to use the data table messages. Use the << Select Where( Boolean expression) message to select rows or the << Get Rows Where( Boolean expression) message obtain a list of matching rows.