Subscribe Bookmark
gail_massari

Community Manager

Joined:

Feb 27, 2013

Expression Columns in Data Tables

This article appears in JMPer Cable, Issue 30, Summer 2015.

by Craige Hales Craige@JMP, Principal Systems Developer, SAS

JMP developers were listening when users asked to be able to add pictures in data tables to make the data more informative. JMP 12 gives you pictures and more: objects such as matrices and lists, JSL (JMP Scripting Language) code, and JSL expressions for pictures can all be kept in an expression column. Expression columns provide information for display and analysis as well as organize data and speed up scripts.


Expression columns make a special case out of picture expressions because pictures are meant to be seen. (You can turn off the special case and see 1,000 words instead, but I have yet to find a good reason to do that.) Pictures can be dragged and dropped into expression columns; they can also be downloaded from tables on the web. During our testing phase, we discovered that Wikipedia is an interesting source of tables with pictures.

Pictures are useful in a variety of ways. You can use pictures in a table to help locate a row, such as a picture of a sample or an outlier. You can use the pictures as a visualization. You can have multiple picture columns. You can add the label attribute and get popup tool tips with pictures in your graphs.

Here’s an example using SAS offices plotted on a map. The map shows the geographical relationship. When you hover over a point, a photo of that location pops up. I’ve pinned this tip off to the side and turned on the tagline to Glasgow (Figure 1).

Fig1.jpg

Figure 1 Photo of the SAS Country Office in Glasgow

The photo shown in Figure 1 was created from the sample data table shown in Figure 2.
Fig2.png
Figure 2 Sample data table with expression column

You can also make the table rows taller as shown in Figure 3.

Fig3.png

Figure 3 Resized expression column

A matrix is a great example of how you can put other expression data in an expression column. Rather than using nine columns for a 3x3 matrix, just store the 3x3 matrix as a matrix. Your JSL code will be faster because it won’t need to remake the matrix from nine values anymore. The matrix might be a transform matrix as shown in Figure 4.

Fig4.png

Figure 4 A matrix in an expression column

Expressions columns are not the same as Formula columns; in fact, a column can be both. A Formula column has a single formula expression that generates the values for every cell. The values in the cells of an Expression column are expressions that can be evaluated.

Expression columns give JMP a new visualization tool using pictures in columns, as well as other possibilities for better scripting performance and better data organization.

To explore this topic further, see JMP documentation on expressions in columns, see Column Properties.

Article Tags