Spotfire Axis Names

  • Are you aware that you can write expressions on the Y-Axis but have no idea how?
  • Is the syntax for writing expressions on the Y-Axis confusing?
  • Would you like to expand your Spotfire calculation skills?

In my opinion, Axis Names are a difficult subject to grasp, and there aren’t many resources out there.  TIBCO Help has good information, but broader context to understand concepts is missing.   There is very little general information in Google searches.  Search results take you to the TIBCO Community and TIBCO Documentation, but again, that broader context is missing.  It’s an uphill battle.  I aim to fix that.

Last year, I posted an Intro to Axis Names template on Exchange.at that you can download using this link.  Now, this template is a great introduction, but there’s so much more to learn.  Thus, I  have built two more templates explaining Axis Names.  Specifically, they each address Axis Names for Reference Lines and Axis Names for Visualization Properties.  The combined content plus this blog post provides all you need to know.  Let’s get started.

What are Axis Names and why do we need them?

To answer that question, let’s first talk about calculations in general.  In Spotfire, there are two ways to write expressions.

  1. Insert menu > Calculated Columns
  2. Custom Expression written on the axis or variable selector of a visualization

Each method uses a different syntax.  Most users are familiar with the syntax for method one, and Axis Names are used with the second method.  So, why not just learn the syntax of one method and then stick with that method?

Well, with the first method, calculated columns are inserted into the data table, and the result will ALWAYS use the entire data set.  When writing an expression on the value axis of a visualization, the expression considers filtering.  Thus, calculations can be performed on subsets of data.  As you can see, it’s very important to understand both calculation methods.

Now, of course, the second method uses a different syntax.  It uses Axis Names.  Here’s a comparison of the two different syntaxes.  For this example, let’s assume we have months on the X-axis.  Thus, the expression reads — Take the sum of gas for the individual nodes on the X-Axis (for each month) and divide them each by the sum of gas for all nodes (or months) on the X-axis.

Axis Names Syntax

Axis Names Example

Show Me an Axis Name

Okay, so you’re starting to get the idea.  Next, let’s talk scope.  As you can see from the table below, there are a lot of Axis Names. Axis Names apply to specific visualizations. If this is a bit overwhelming, skip down and come back after you have gone through an example or two in the template.

Cross Table Axis.Columns Axis.Measures Axis.Rows
Graphical Table Axis.Rows
Bar Chart Axis.Color Axis.Columns Axis.Pages Axis.Panels Axis.Rows Axis.X Axis.Y
Line Chart Axis.Line Axis.Color Axis.Columns Axis.Pages Axis.Panels Axis.Rows Axis.X Axis.Y
Combination Chart Axis.Color Axis.Columns Axis.Pages Axis.Panels Axis.Rows Axis.X Axis.Y
Pie Chart InnerAxis.Color InnerAxis.SectorSize
Scatter Plot Axis.Color Axis.Columns Axis.Pages Axis.Panels Axis.Rows Axis.Size Axis.X Axis.Y Axis.Marker Axis.Shape InnerAxis.Color InnerAxis.SectorSize
3D Scatter Plot Axis.Color Axis.Columns Axis.Marker Axis.Pages Axis.Panels Axis.Rows Axis.Size Axis.X Axis.Y Axis.Z
Map Chart Axis.Color Axis.Columns Axis.Marker Axis.Pages Axis.Panels Axis.Rows Axis.Size Axis.X Axis.Y InnerAxis.Color InnerAxis.SectorSize Axix.Identifer
Treemap Axis.Color Axis.Columns Axis.Pages Axis.Panels Axis.Rows Axis.Size Axis.Hierarchy
Heat Map Axis.Columns Axis.Pages Axis.Panels Axis.Rows Axis.Size Axis.X Axis.Y Axis.Measures
Parallel Coordinat Plot Axis.Line
Summary Table Axis.CategoryAxis

Let’s Talk Syntax

Now, let’s talk a little bit more about the syntax and the rules around Axis Names.

  1. When writing an expression on the Y-Axis (or Value Axis) of a visualization…
    1. Over and Node Navigation must go with Axis Names, and the expression requires an aggregation.  If you are unfamiliar with Over and Node Navigation, take a look at this blog post on node navigation and this post on over.  You need to have a solid understanding of Over and Node Navigation before diving into Axis Names.
    2. Wrap the Axis Name in square brackets, just like column names.
    3. The syntax uses the word Axis followed by “.”, followed by the specific name (Color, Line, etc).
    4. Axis Name values are case sensitive.  Axis.X is recognizable, but Axis.x is not.
    5. Which Axis Name is used depends on the type of visualization and what you are trying to accomplish.
    6. When using Axis Names, the X-axis needs to categorical.  In oil and gas, it’s common to put Production Months on the X-Axis, which is continuous.  Thus, you must either create a one level hierarchy or change the X-axis to categorical. They axis must be categorical because the expression is “thinking” in terms of “nodes”.  Nodes are categorical.
  2. When writing expressions for properties…
    1. You must add either Axis.Name.Expression or Axis.Name.DisplayName to the end of the Axis Name.  This is specifically addressed in the Axis Names for Visualization Properties template downloadable at this link.

In Summary

Axis Names Summary

 

And with that, you know almost everything you need to know about Axis Names.  This was a lot of information to digest, and you have three templates to review.  Don’t worry if this seems difficult.  It’s not an easy concept to grasp, and it takes working with it for a while to really get the hang of it.  Please feel free to reach out with any questions.  Thanks!

 

Guest Spotfire blogger residing in Whitefish, MT.  Working for SM Energy’s Advanced Analytics and Emerging Technology team!

Leave a Comment

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