- 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])))
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.
Guest Spotfire blogger residing in Whitefish, MT. Working for SM Energy’s Advanced Analytics and Emerging Technology team!