Business Intelligence Tools

Spotfire Functions – Lines & Curves – Line from Column Values

  • Have you struggled to add type curves to visualizations?
  • Would you like to add lines to a plot and be able to change the format?
  • Have you tried to use Line from Column Values before and gotten a jumbled mess?

This is the last part of a 5 part series on Lines & Curves.  I will conclude the series with Line from Column Values, which will by far be the longest of the posts, as it requires attention to detail to explain thoroughly.  I will start by explaining how to add Line from Column Values in terms of what needs to be selected in the dialog.  Then I will show the first mistake I made with Line from Column Values, which is the platform for breaking down how the function works.  Next we’ll discuss how to use Line from Column Values to add type curves to a visualization, and I’ll conclude with a discussion on how to use Relations to get even more of Line from Column Values.

The steps to add Line from Column Values include:

  1. Right click on the visualization, select Properties
  2. Go to the Lines & Curves menu, click the Add drop down and select Line from Column Values
  3. In Data table with line values: Select the data table the line should be added from.
  4. In X-values column: Specify the values that should be used for the x axis.  Generally speaking, this should be in the same format as what is already on the visualization (ex. a production date versus a count of days on production).
  5. In the Y-values column: Specify the values that should be plotted with the line
  6. Sorted by column: Specify the order in which the line should be drawn through the points.  This is usually X-values column for sorting of the rows.  Basically, there is more than one way to draw a line through multiple points, so this option is asking how to draw the line through the markers.
  7. I recommend giving the curve a custom name.


Now, let’s go to the first mistake I made with Line from Column Values.  In my first experience,  I had a table of production data (many days, many wells), and I simply wanted to plot the sum of BOE with the sum of oil and gas values but be able to format the BOE line as dashed.  I knew my only option to do this was Line from Column Values, but it turn out like this and crashed the application.


I realized I had no idea what the function was doing, so decided to plot something simpler.  In this example, I filtered down to only two wells, and I put oil and gas on the y axis and again attempted to add BOE as a dashed line.  I did in fact get a dashed line, but as you can see, the line travels the length of the x axis (goes through all the dates) and then it jumps up and travels the length of the x axis again.  It does this because it is plotting the BOE for the two wells that I have filtered my data set down to.  If I add another well to the data set, you would see it travel the length of the axis and jump again.  That’s why my first attempt was a jumbled mess.


Note: This visualization is line by (Column Values), not line by well.


Here is a second example.  In this case, I removed sum([Gas]) and left only sum([Oil]).  I still have only two wells in the data set and have line by set to Well.  Again, you can see that my Line from Column Values is running the length of the x axis and then jumping to plot the BOE line for each well in the data set.


What I learned from this was that with Line from Column values, each point in the filtered data set will be plotted on the visualization.  If you have two wells in a data set and two markers for each production month, then that is what will be plotted.  Line from Column Values does not aggregate.

Now that we understand how the function works, let’s look at what it takes to plot a type curve on a data set, which is slightly different because your type curve data is probably like mine, which means it’s in a separate table from the production data set.  This is my starting point — a line chart with production months on the x axis and cum production/ 1000 ft on the y axis.  I have one line for each well.


This is my type curve table.  I have producing months, similar to what is on my visualization, along with cumulative production / 1000 ft.  Now, what makes this work so easily is that I only have one record per producing months in the table.  You can tell this because I have sorted by c.Producing Months.  If I had multiple values for each producing month, you would see the same behavior as the first example, where the line traveled the length of the x axis and then jumped back to the start.  The line I am about to add will only travel the length of the x axis one time because there is only one value per producing month.


I can easily add a Line from Column Value using these settings


This is the result — production for each well with the type curve overlaid.


Before I close out the post, I want to show one more example where the type curve table has more than one record per producing month.  More specifically, the table has 16 type curves, each with 40 months of data, as well as a classification of short or long lateral length.  (see table below)

Here is the type curve table


Note that the gas columns are calculated.  One is meant for long lateral length and returns null for the short and vice versa.  Also note that a single type curve can have records for both long and short lateral length.


Here is the production table (called Wells table).  There is a unique identifier for each well and a well name in the table.  I have cut it off for spacing considerations.



Here is the starting visualization.


Here are the Lines & Curves adds.  The long line will only populate with “long” type curves because the Gross We Gas Long Daily is calculated to return null for all short type curves.  Vice versa for short.

short long

There is one other critical step to making this particular example work, and that is adding a relation on the Type Curve between the two tables and configuring the Type Curve table to Include Filtered Wells only.


If this step is skipped, the result will look something like this…where no filtering is applied in the type curve table.



This is the finished result.  Note, a filter has been added to a text area, which is connected to the wells table.  This allows the user to look at one type curve at a time.  Because of the relation, the type curve table is also filtered.


Well that covers it for lines and curves.  I hope you found this series useful.  Please feel free to leave comments.


8 thoughts on “Spotfire Functions – Lines & Curves – Line from Column Values

  1. Sean Reply

    Trying to add a Typecurve to a plot with multiple normalized curves behind it. The monthly production table is in a tabular format (each row is a well name, date, corresponding gas,oil,etc.). I’m only plotting normalized gas, line by API#. My typecurve table has months in the first column and each typeurve is the gas volumes for each area.

    I try to add just the months as X and one of the columns as the Y. But nothing shows up, The plot is normalization column for X and sum of gas for Y (again line by API).

    I tried making the relation of the normalized column to the months column in the TC table but that didn’t work.

    Do you have any idea what Im doing wrong? Thanks in advance

    • Julie Schellberg Reply

      In your type curve table, you need to have each type curve in a different column, and only one record per normalize month. I couldn’t quite tell from your description if that’s what you have. You shouldn’t need a relation or column match, just to have the normalized months on your x when you setup the line. For troubleshooting, you could try adding it to a different visualization and see if it appears. Also, make sure the line is formatted.

  2. Pingback: Missing Options in Lines & Curves • The Analytics Corner

  3. Matt Luna Reply

    How do you create dashed lines (i.e, if I wanted to make the type curve a dashed line)?

    • Julie Sebby Post authorReply

      Change the formatting of the line in lines and curves. The type curve must be added as a line/curve to change the formatting.

  4. Pingback: Horizontal Line Limitations in Lines & Curves — Data Shop Talk

Leave a Reply

Your email address will not be published. Required fields are marked *