Line from Data Table vs. Line from Column


One of the most common questions we get in our training classes is to explain the difference between Line from Data Table and Line from Column.  So much so, that we thought it would make a nice topic for a tip, actually two tips.  This tip will be the first in a two-part series where we explore the different options for drawing lines in Spotfire. Next week’s tip will focus on the different options for drawing curves in Spotfire. Specifically, we will look at the options which allow you to draw from values in other data tables.

To start with, let’s assume we are looking at data for subjects in a clinical trial or similar, and want to analyze their cholesterol. The data table would have one row for each subject, and would contain the identifier of each subject (in this case we will use their first name), the age of each subject, and their total cholesterol level.

 

 
To see if there is a correlation, we may want to display their cholesterol by age.  To do this, we can create a Scatter Plot, putting the Age column on the X-Axis, and the Total Cholesterol Level on the Y-Axis,


 

 

Now, we can add in a variety of built-in lines to our Scatter Plot to further our analysis. We can vertical lines, horizontal lines, and straight line fits. These features are all required to draw lines using values from the Data table currently used in the Scatter Plot.

 


Suppose we have a second Data table, called ‘Limits’ which shows a high and low limit for the  cholesterol.



 

We can use the ‘Horizontal Line from Data Table’ to draw these limits as horizontal lines on our Scatter Plot.

 Step 1: Launch the Line From Data Table dialog from the Lines & Curves Properties dialog


 

  Step 2:  Specify the Data table to use and then which column to use to draw the line(s)

 


  Step 3: The lines are drawn in red. Since there are two unique values in the specified column, there are two lines

 

 
Next, let’s say we want to compare the subject's cholesterol by age against the county's average by age, and we happen to have the county averages in a third Data table.



 

We can now use the Line from Column Values feature to draw a line using the x (Age) and y (Country Cholesterol Average) values from the Country Averages data table.


 Step 1: Launch the Line From Column Values dialog from the Lines & Curves Properties dialog



 

  Step 2:  Specify the Data table to use and then which columns to use for the X and Y values

 

  Step 3: The line is drawn in blue. 


To summarize, both Line from Data Table and Line from Column Values draw lines on a given visualization. The difference is that ‘Line from Column Values’ uses two columns of data (one defines X and one defines Y).  ‘Line from Data Table’ uses each value in a column to define a Y value for a horizontal line  or a vertical line (often resulting in multiple lines).  

Next week we will look at the differences between Curve From Data Table and Curve Draw.