Select All Rows selects (or highlights) all of the rows in a data table.
If all rows are selected, you can deselect them all by using Invert Row Selection. This command reverses the selection state for each row, so that any selected rows are deselected, and any deselected rows are selected.
注意:With the exception of Invert Row Selection, whose result depends on the current selection, any new selection message starts over with a new selection. If you already have certain rows selected and you then send a new message to select rows, all rows are first deselected.
To select a specific row, use Go To Row:
To select specific rows in a data table based on their row number, use the Select Rows command. The argument to the command is a list of row numbers. For example, to select rows 1, 3, 5, and 7 of a data table, proceed as follows:
To select rows according to data values, use Select Where, specifying a logical test inside the parentheses.
提示:For a description of the functions and operators that you can use within a Select Where message, see “Operators” on page 89 in the “JSL Building Blocks” chapter.
For example, using the Big Class.jmp sample data table, select the rows where the students’ age is greater than 13:
The following example selects the rows where the student’s ages are less than 15 and the sex is “F”:
To select a row without deselecting a previously selected row, combine << Select Where with << Select Where and the Current Selection("extend") argument. This is an alternative to using an OR statement.
When you use column references to refer to column names in a Where statement, the column references need to be evaluated so they can be resolved to the proper data table. For example, in the following script, the parameters to the X(Xcol) and Y(Ycol) column references are linked to the data table in dt. However, the execution of the platform is associated with the Where subset data table. The script produces an error.
To evaluate the column names to the correct data table, use an Eval() expression or refer to the column names directly.
dt << Bivariate(
Where( :sex == "F" )
To select rows that are not excluded, hidden, or labeled, stack a select message and an invert selection message together in the same statement, or send the two messages sequentially:
To select duplicate rows in a data table, use the Select Duplicate Rows message:
dt << Select Duplicate Rows();
dt << Exclude();
To select duplicate values in the rows of selected columns, specify the column names. The following example finds duplicate values in the rows of the Incident Number and Time columns.
To refer to a specific cell, assign a subscript to the cell’s row number. In the following example, the subscript [1] is used with the weight column. The formula then calculates the ratio between each height and the first value in the weight column.
The row menu command Select Matching Cells is also implemented in JSL.