Spotfire Expressions — 2 ways to write expressions with OVER and node navigation

  • Would you like to learn more about the Spotfire expression language?
  • Are you having difficulty getting the right level of detail in your calculations?
  • Are you struggling with calculated columns?

In the last post, I covered OVER, intersect and node navigation methods.  Now that you are familiar with them, know that there are two ways in which expressions can be written.  As you can see in the screenshot below, both expressions will calculate a cumulative sum of OIL production for each Lease.  In the first expression, the node navigation method is referenced within the intersect.  In the second expression, the column that should be used in the intersect is specified first, followed by the node navigation method.  The result is the same.

Sum([OIL]) OVER (intersect(AllPrevious([D_DATE]),[c.Lease]))

Sum([OIL]) OVER (intersect([c.Lease],AllPrevious([D_DATE])))

 

8-15-2016 6-43-39 PM

I prefer to use the second syntax.  I feel this is easier to think through.  For example, I read this expression as — Give me the sum of oil for each Lease for all previous D_Dates.

2 thoughts on “Spotfire Expressions — 2 ways to write expressions with OVER and node navigation

Leave a Comment

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