Hi,
I just detected 2 nasty bugs in Tables/Summary.
One of them can even be used to make JMP crash on any PC (!!!)
Bug 1) Please read this code and predict what Jmp will do:
Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Summary(
Local Data Filter( Add Filter( columns( :sex ), Where( :sex == "X" ) ) ),
Group( :sex ),
Mean( :height ),
Link to original data table(0),
output table name( "average o students with sex = \!"X\!"" )
);
In BigClass there are no students with sex="X". So, I expected the list to be empty:
Filter: sex= "X" / no "X" in the table -> empty summary table
Unfortunately, the logic in Jmp is surprisingly different:
If the DataFilter doesn't find a match, the Data Filter gets reset and shows ALL data.
For Dashboards, Outlier (👽) screening with Jmp Dashboards - how? TS-00046650, it's "just" annoying that the restriction is not applied - for automatic statistical analysis via Tables/Summary the issue is more severe: at the end, there is the wrong result - no Data Filter on the left of a Dashboard where the user can detect and correct the issue.
Since Jmp 17, there is this cool new feature: Remove Excluded Rows
unfortunately, there is:
Bug # 2:
If you have Jmp 17 or Jmp 18 EA, please try run this code twice - store your data, Jmp will crash!
Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Summary(
Local Data Filter( Add Filter( columns( :sex ), Where( :sex == "F" ) ) ),
Group( :sex ),
Mean( :height ),
Remove Excluded Groups,
Link to original data table(0)
);
// today no females
dt << Select where( :height < 67 ) << Exclude;
After running the code the first time, due to the restriction of the data filter, the summary table shows the average height of the female entries. Then the line at the end of the code excludes all rows with height < 67, among them all female entries.
Now, run the code again:
The rows with sex="F" are still there, they are just excluded. So, compared to bug #1, here the Data Filter doesn't get reset.
It will restrict the analysis to rows with sex = "F". These rows are excluded by the data filter of the data table.
In total, there is no matching non-excluded row. As a consequence: Remove Excluded Rows has a lot to do - and gets angry.
So angry that Jmp crashes.
It's clear that without matching rows the user will have little benefit from the result. But in a long script there could be something like:
Please average the height of the female students in the class who also match some additional filter settings which were applied via the main table.
Under the line:
Let's assume that I want to count the female students in a class and calculate their average height. By using Jmp/Tables/Summary with a Data Filter:
- if there are no female students in the class, Jmp will count the male students and average their ages (!!!)
- if there are >=1 female students in the class, but the respective rows got excluded, Jmp will crash (!!!)
[if Remove Excluded Rows is enabled]