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:
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:
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;
;