cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar

Overview of Tables

Started ‎11-08-2022 by
Modified ‎11-08-2022 by
View Fullscreen Exit Fullscreen

Now, in addition to storing your data and its metadata, the data table is responsible for data preparation using commands in the Tables, Rows, and Columns menus, or their equivalent messages in JSL. The data table is also responsible for launching the platforms for analysis and graphing. Sometimes, you only want to analyze or plot a specific subset of the data values that are stored in your data table. In that situation, you can use row states to control the data values that a platform includes in its analyses, or displays in its graphs. But you can also create a new, separate data table to hold that specific subset of the values. There are several ways to indicate which rows and columns you want to include in a subset table. The simplest way is to select the rows or columns that you want, and then send a message to the data table to create a subset. But you can also supply arguments to the message to specify the rows and/or columns without needing to select them first. If no columns are selected, and the message doesn't indicate specific columns, then by default, all of the columns will be included in the subset. And that works the same way for rows. So how do you select rows or columns for a subset data table? Let's start with rows. You've seen that there are several messages that can be sent to a data table to select rows, but probably the most commonly used one for creating subsets is the Select Where message, which takes a Boolean expression as its argument. In the example shown here, the Select Where message selects the rows from the Big Class data table where the height is greater than inches and the weight is greater than pounds. An alternative would be to use the data filter message to make the selection. However, the data filter message requires a lot more code than Select Where. The two messages shown here are doing the exact same thing. So typically, if you want the script to select rows based on some logical criteria, you'll use Select Where. But, if you want to enable the user to continue exploring the data after the script runs, your script could launch the data filter, specify filter columns, and then let the user make selections interactively. Now let's talk about selecting columns, and determining which columns are selected. There are two messages that are sent directly to a column, while others are sent to the data table. You can send the Set Selected message to a column to select it for the subset. And, you can determine if a column is already selected by sending the Get Selected message to it. You can select an individual column by sending the Go To message to the data table with the column name or number as its argument. Similarly, you can send the Select Columns message to the data table to select a single column, a list of desired columns, or even all the columns. If you need to determine which columns are already selected, you send the Get Selected Columns message to the data table. And then you can clear any existing selections by sending the Clear Column Selections message to the data table. Lastly, if you've grouped columns in the columns panel, you can use the Select Column Group or Deselect Column Group messages to work with a group of columns together. Once you've selected the rows and or columns, you send the Subset message to the original data table to create a subset. JMP creates a new data table from the data values that you specify. It's not required, but if you've already selected the rows and/or columns that you want to include in the subset, it's a best practice to use the Selected Rows or Selected Columns arguments with a Boolean one in parentheses. The code shown here is an example of cascading messages. The Select Where message is sent to the data table to select the rows where the values in the column sex are F, immediately followed by the Subset message specifying two columns for the subset table and the table's name. But, you don't have to select the rows and columns first. Another way to specify which rows and columns that you want to include in the subset table is to use the Rows argument with a matrix of row numbers, or the Columns argument with the column references. In this case, it's a best practice to use the Selected Rows or Selected Columns arguments with a Boolean zero in parentheses, in case the table has selected rows or columns.