Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- remove filter using script

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

remove filter using script

Jan 21, 2010 11:38 AM
(2629 views)

I have used script to apply filters in order to run frequencies on the dependent data, but haven't figured out how to remove all filters using script -- what are my options?

For example, here's my applying filter script:

Current Data Table() << Data Filter(

Add Filter(

columns( :key ),

Where( :key == {1, 3, 4, 5, 6, 888, 999} ),

Display( :admit.type, Size( 204, 140 ), List Display )

),

Mode( Show( 1 ), Include( 1 ) )

);

Distribution(

Nominal Distribution( Column( :admit.type.other ) ),

);

After I've run this, what script do I use in order to remove the filter?

Thank you!

For example, here's my applying filter script:

Current Data Table() << Data Filter(

Add Filter(

columns( :key ),

Where( :key == {1, 3, 4, 5, 6, 888, 999} ),

Display( :admit.type, Size( 204, 140 ), List Display )

),

Mode( Show( 1 ), Include( 1 ) )

);

Distribution(

Nominal Distribution( Column( :admit.type.other ) ),

);

After I've run this, what script do I use in order to remove the filter?

Thank you!

5 REPLIES 5

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: remove filter using script

it just came to me:

Current Data Table() << Clear Row States;

Current Data Table() << Clear Row States;

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: remove filter using script

I see this resets the row states in the data table, but I can't see how to add new filters to the existing fillter.

Simply running a new Add Filter doesn't seem to work, I must be missing something.

My objective is to apply one filter and create a subset for charting. Then clear the existing filter, apply a different filter and create a second subset.

Simply running a new Add Filter doesn't seem to work, I must be missing something.

My objective is to apply one filter and create a subset for charting. Then clear the existing filter, apply a different filter and create a second subset.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: remove filter using script

Here's an example that might help. I still cannot make the filter window go away after I'm done via scripting. Must be a way though. The following script assumes that the Fitness data is current.

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: remove filter using script

I am having the same issue as Khill, I am trying to run the same contingency analysis for many different year combinations.

Here is the script that I am working on. The script runs well for the first year combination (2006, 2007). Then when I clear the selected rows and try filtering again for the next year combination (2006,2008), the filter doesn't get set, and I get a contingency analysis for all the years of data. I think I am missing something basic.

Please help, I am new to JMP and scripting, but I am enjoying the puzzle.

dt = Open("D:\T_drive\M03-SISP2-Mon\2010-SISP2-GridMon\ZPP\S_sox_0607080910_Merge.jmp")

<< Data Filter(

Location( {849, 180} ),

Add Filter( columns( :Year_ ), Where( :Year_ == {2006, 2007} ) ),

Mode( Include( 1 ) )

);

Contingency(

Y( :LT5m ),

X( :Year_ ),

Contingency Table(

Count( 1 ),

Total %( 1 ),

Col %( 1 ),

Row %( 1 ),

Expected( 0 ),

Deviation( 0 ),

Cell Chi Square( 0 ),

Col Cum( 0 ),

Col Cum %( 0 ),

Row Cum( 0 ),

Row Cum %( 0 )

)

);

dt <

Current Data Table() << Data Filter(

Location( {849, 180} ),

Add Filter( columns( :Year_ ), Where( :Year_ == {2006, 2008} ) ),

Mode( Include( 1 ) )

);

Contingency(

Y( :LT5m ),

X( :Year_ ),

Contingency Table(

Count( 1 ),

Total %( 1 ),

Col %( 1 ),

Row %( 1 ),

Expected( 0 ),

Deviation( 0 ),

Cell Chi Square( 0 ),

Col Cum( 0 ),

Col Cum %( 0 ),

Row Cum( 0 ),

Row Cum %( 0 )

)

);

dt <

Current Data Table() << Data Filter(

Location( {849, 180} ),

Add Filter( columns( :Year_ ), Where( :Year_ == {2006, 2009} ) ),

Mode( Include( 1 ) )

);

Contingency(

Y( :LT5m ),

X( :Year_ ),

Contingency Table(

Count( 1 ),

Total %( 1 ),

Col %( 1 ),

Row %( 1 ),

Expected( 0 ),

Deviation( 0 ),

Cell Chi Square( 0 ),

Col Cum( 0 ),

Col Cum %( 0 ),

Row Cum( 0 ),

Row Cum %( 0 )

)

);

Here is the script that I am working on. The script runs well for the first year combination (2006, 2007). Then when I clear the selected rows and try filtering again for the next year combination (2006,2008), the filter doesn't get set, and I get a contingency analysis for all the years of data. I think I am missing something basic.

Please help, I am new to JMP and scripting, but I am enjoying the puzzle.

dt = Open("D:\T_drive\M03-SISP2-Mon\2010-SISP2-GridMon\ZPP\S_sox_0607080910_Merge.jmp")

<< Data Filter(

Location( {849, 180} ),

Add Filter( columns( :Year_ ), Where( :Year_ == {2006, 2007} ) ),

Mode( Include( 1 ) )

);

Contingency(

Y( :LT5m ),

X( :Year_ ),

Contingency Table(

Count( 1 ),

Total %( 1 ),

Col %( 1 ),

Row %( 1 ),

Expected( 0 ),

Deviation( 0 ),

Cell Chi Square( 0 ),

Col Cum( 0 ),

Col Cum %( 0 ),

Row Cum( 0 ),

Row Cum %( 0 )

)

);

dt <

Current Data Table() << Data Filter(

Location( {849, 180} ),

Add Filter( columns( :Year_ ), Where( :Year_ == {2006, 2008} ) ),

Mode( Include( 1 ) )

);

Contingency(

Y( :LT5m ),

X( :Year_ ),

Contingency Table(

Count( 1 ),

Total %( 1 ),

Col %( 1 ),

Row %( 1 ),

Expected( 0 ),

Deviation( 0 ),

Cell Chi Square( 0 ),

Col Cum( 0 ),

Col Cum %( 0 ),

Row Cum( 0 ),

Row Cum %( 0 )

)

);

dt <

Current Data Table() << Data Filter(

Location( {849, 180} ),

Add Filter( columns( :Year_ ), Where( :Year_ == {2006, 2009} ) ),

Mode( Include( 1 ) )

);

Contingency(

Y( :LT5m ),

X( :Year_ ),

Contingency Table(

Count( 1 ),

Total %( 1 ),

Col %( 1 ),

Row %( 1 ),

Expected( 0 ),

Deviation( 0 ),

Cell Chi Square( 0 ),

Col Cum( 0 ),

Col Cum %( 0 ),

Row Cum( 0 ),

Row Cum %( 0 )

)

);

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: remove filter using script

Try this -

df = Current Data Table() << Data Filter( Add Filter( columns( :age, :sex, :height ) ));

df << delete(:age);

df << delete all;

df << close window;

df = Current Data Table() << Data Filter( Add Filter( columns( :age, :sex, :height ) ));

df << delete(:age);

df << delete all;

df << close window;

Article Labels

There are no labels assigned to this post.