Jump to content

The first visualization shows the sum of Adjusted Cum Production in MBOE/1000 FT using Color/Line by Lease.


Julie Schellberg 3

Recommended Posts

In the attached screen shot, I have two visualizations. The first visualization shows the sum of Adjusted Cum Production in MBOE/1000 FT using Color/Line by Lease. I also have a Line from Column Values on on the plot represented by the black dashed line. The x axis isc.Producing Months, which is a calculated column representing the number of months a well has been on production.

This visualization works, but I would like to add an average line to the plot that is the average of Adjusted Cum Production MBOE/1000 FT for only the wells I have filtered to. I know that I need to write the average formula on the y axis so it only uses the wells I have filtered to. I also know that to make that visualization work, I need a hierarchy on my x axis.

The second visualization includes an average line as I have described, but I have lost the line from column values because Spotfire won't let me make the x axis continuous. With the hierarchy, it appears that it is forcing it to be categorical. Is there anyway to get around this

Again, what I am trying to create is something similiar to the top visualization but with the addition of an average line that is just the average for the filtered wells. Thank you!

Link to comment
Share on other sites

  • 2 weeks later...
Write an R or TERR script to average the filtered data and output the results to another data table to be used in line from column values. Register that script as a data function in the library or embed it in the dxp. The input and outputs need to be mapped in the data function but once setup the avg line will update as the filters are changed.
Link to comment
Share on other sites

  • 3 months later...

Just did something similar. See if this might work by adding it via custom expression on the Y. I am using regular production date on the x. This reacts to filtering and to changing the date range. I used this on a combo chart to get a line that is the average over time for a particular set of bars.

The first half of the expression just gives the sum for a bar on the chart. The second half after the "," is for the average which is a line.

Sum([Chem Costs / Monthly BOE-6]) as [Chem Costs / Monthly BOE-6],

Sum([Chem Costs / Monthly BOE-6]) THEN Avg([Value]) OVER (all([Axis.X])) as [Avg Chem/BOE]

Link to comment
Share on other sites

I have done this a couple of ways. In order of usefulness:. 1) Use a data function for the avg to create a table for line from column values 2) Use a property control for filtering then use the property in a calculated column using an over statement. It works but might not interact with the chart for your desired outcome.3) Create a TERR expression function to use as a custom expression. I haven't tried the 3rd but it should work as well as #1.
Link to comment
Share on other sites

  • 6 months later...

Register Data Function

Call it what you want.

Checking "Allow caching"

In script box paste:

# organize the inputs into a dataframe

# substitute Oil, Lease, ProdDate with names of your base matching columns (don't use aggregated production columns here)

data = data.frame(Oil, Lease, ProdDate)

# Get rid of downtime days

data = data[data$Oil>0,]

if(nrow(data) == 0) {

Results Table

Now Edit Parameters:

Input Tab

Check Refresh function automatically

For each Oil, Lease and ProdDate select Column in theInput Handler and point to respective table and column, also Limit by: Your filter scheme or select a marked rows filter

MonthsBin should just be a DocumentProperty slider or input field which for averaging month to month you would select or input 1

Output Tab

Create New Data Table nameit "Results" (after you run script and the table is created, you'll want to change to replace existing data table, select Results table.

Now you go to lines&curves on graph and ass line from column values and select Results Table and months on x axis and Oil on Y axis and it should appear and be interactive.

Link to comment
Share on other sites

  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...