I want to do some Outlier screening by listing the aliens in my class.
First attempt: Local Data Filter
I was quite shocked with all the aliens in Big Class!
... but then I noticed that the data filter was just ignored (because on day 1 there were no aliens in the class - and with no matching rows, the Data Filter is just reset - instead of showing 0 matching rows !!!).
This seems to be related to Data filter: how to specify the limits :
If a value is just used in the data filter but not in the data table, it is removed from the data filer.
This behavior interferes with another behavior of Jmp: if the last filter value is deselected, all rows get selected (instead of none).
So, with the current behavior of Data Filters, this approach doesn't work
Next, I used a Where() clause to restrict the Tabulate Report.
Unfortunately, if one day there are no aliens in the class, the Where clause produces an error message - instead of restricting the data set to 0 rows:
This Where-clause for data table 'Big Class' resulted in no rows: :alien == 1
List of "aliens" for the 4 cases:
![hogi_0-1689669620344.png hogi_0-1689669620344.png](https://community.jmp.com/t5/image/serverpage/image-id/54829iCE5F107AB37E3439/image-size/medium?v=v2&px=400)
![hogi_1-1689669653552.png hogi_1-1689669653552.png](https://community.jmp.com/t5/image/serverpage/image-id/54830i6E080BFAB3EB9BA1/image-size/medium?v=v2&px=400)
![hogi_6-1689669864204.png hogi_6-1689669864204.png](https://community.jmp.com/t5/image/serverpage/image-id/54835i735886BD00EDF0D3/image-size/medium?v=v2&px=400)
![hogi_7-1689669921267.png hogi_7-1689669921267.png](https://community.jmp.com/t5/image/serverpage/image-id/54836i49CF25FEFEBCD431/image-size/medium?v=v2&px=400)
Please note:
For the case with Where(), there is another issue:
The row selection for the report is static.
After XX changed to non-alien - he is still listed in the report:
![hogi_2-1689013063862.png hogi_2-1689013063862.png](https://community.jmp.com/t5/image/serverpage/image-id/54549i91B77F0DC8831CC6/image-size/medium?v=v2&px=400)
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Column( "alien", nominal, set each value( 0 ) );
myDashboard = Function( {myTitle, withWhereClause},
New Window( myTitle,
<<Show Menu( 0 ),
<<ShowToolbars( 0 ),
Tab Box(
Tab Page Box(
"aliens",
Eval(
Substitute(
Expr(
Tabulate(
Show Control Panel( 0 ),
Add Table( Row Table( Grouping Columns( :sex, :age, :name ) ) ),
__selectAliens__
)
),
Expr( __selectAliens__ ),
If( withWhereClause,
Expr( Where( :alien == 1 ) ),
Expr(
Local Data Filter( Close Outline( 1 ), Add Filter( columns( :alien ), Where( :alien == 1 ) ) )
)
)
)
)
),
Tab Page Box(
"all Students",
Tabulate( Show Control Panel( 0 ), Add Table( Row Table( Grouping Columns( :sex, :age, :name ) ) ) )
)
)
)
);
// 1) Data Filter --> so many aliens ?!?! no, Data filter was ignored (filter is OK, see below)
myDashboard( "1) Data Filter, no alien", 0 );
// 2) Where Cause + no matching row --> error message instead of a report
myDashboard( "2) Where(), no alien", 1 );
dt << add rows( {name = "XX", alien = 1, sex = "M", age = 200} );
// 3) Data Filter + 1 alien
myDashboard( "3) Data filter, 1 alien", 0 ); // new test: --> filter OK --> works
myDashboard( "4) Where(), 1->0 aliens ...", 1 ); // Where Clause + matching row --> dashboard is created, but ...
// XX gets human -> Dashboard #4 stays the same :(
//dt[41, {"alien"}] = 0;
;