Subscribe Bookmark RSS Feed
Jeff_Perkinson

Community Manager

Joined:

Jun 23, 2011

Creating a Simple Dashboard in JMP

This blog post was written by a blogger who is no longer at SAS

Business users have been flocking to JMP for its data visualization and analytical capabilities. You can create a simple dashboard with a minimal amount of scripting. The functions that I will use are: New Window(), H List Box(), and V List Box().


The New Window() command creates a new report window where all of your analyses will be placed. H List Box () and V List Box() allow you to visually arrange analyses horizontally and vertically, respectively. Without specifying H List Box() and/or V List Box(), all analyses will appear stacked on top of each other.


Let’s build a dashboard step by step:


1. In a new script window, use the following code to open a JMP data table.


MyDataTable = Open( "$SAMPLE_DATA/Big Class.jmp" );


I am using the Big Class data table found in the JMP sample data directory. However, your path may look something like this: “C:/My JMP Analyses/Favorite JMP Data.jmp”.


2. Create a new report window.


MyDataTable = Open( "$SAMPLE_DATA/Big Class.jmp" );

New Window( "Student Report", );



The New Window() command requires a title, in this case “Student Report,” and a display box which is left empty for now.


3. Add an analysis to the report. I recommend using the point-and-click method to run an analysis and then take the JSL code that was written behind the scenes. Under the Hot Spot (red triangle) of your analysis report, select Script and then Copy Script. Add the script to your New Window() command as the display box. I’ve used the Bivariate Analysis.


MyDataTable = Open( "$SAMPLE_DATA/Big Class.jmp" );

New Window( "Student Report", Bivariate( Y( :weight ), X( :height ) ) );



4. Add additional analyses by making sure to end each analysis script with a semi-colon. I’ve added Tabulate.


MyDataTable = Open( "$SAMPLE_DATA/Big Class.jmp" );

New Window( "Student Report",

Bivariate( Y( :weight ), X( :height ) );

Tabulate(

Show Control Panel( 0 ),

Add Table(

Column Table( Analysis Columns( :height, :weight ), Statistics( Mean ) ),

Row Table( Grouping Columns( :sex, :age ) )

)

);

);



5. String together analyses horizontally by using the H List Box() command. Display boxes are strung together using a comma: H List Box(Display Box 1, Display Box 2,…). Similarly, string analyses vertically by using V List Box(Display Box 1, Display Box 2,…);


MyDataTable = Open( "$SAMPLE_DATA/Big Class.jmp" );

New Window( "Student Report",

H List Box(

Bivariate( Y( :weight ), X( :height ) );

Tabulate(

Show Control Panel( 0 ),

Add Table(

Column Table( Analysis Columns( :height, :weight ), Statistics( Mean ) ),

Row Table( Grouping Columns( :sex, :age ) )

)

);

)

);




6. You'll find a sample dashboard with multiple analyses stacked horizontally and vertically in the JMP File Exchange under my name. Further dashboard customization, such as coloring data points and adding a title, are also found in the example.