Subscribe Bookmark RSS Feed

remove filter using script

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!
5 REPLIES
it just came to me:

Current Data Table() << Clear Row States;
khill

Community Trekker

Joined:

Jun 23, 2011

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.
mpb

Super User

Joined:

Jun 23, 2011

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.
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 )
)
);
chungwei

Staff

Joined:

Jun 23, 2011

Try this -

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

df << delete(:age);

df << delete all;

df << close window;