0
votes

I am attempting to load some oil and gas production data into spotfire. This data is currently in a time series, ie one column has well name, another has production values (bbls) and then one column has months and another years( I also have a concatenate month/year column). I would like to create another calculated column that contains a day counter, I.e. May 1974 would be day 1 and then June 1974 would be day 32 and so forth.

In excel I would do this with an if statement and reference preceding cells, but being a bit new to spotfire I am unsure how to do this.

Could someone please point me in the right direction? Suggest some functions?

1
can you please post the sample data and expected output? Currently it sounds like you want to emulate the julian calendar but i can't be for certain. Why does may get day 1? - S3S

1 Answers

0
votes

Thanks for the response scsimon.

I solved my problem by creating a case statement for the days in each month and then summing over the days per well for all rowIDs.

case [Month] WHEN "JAN" then 31 when "FEB" then 28 when "MAR" then 31 when "APR" then 30 when "MAY" then 31 when "JUN" then 30 when "JUL" then 31 when "AUG" then 31 when "SEP" then 30 when "OCT" then 31 when "NOV" then 30 when "DEC" then 31 end

Sum([c.Days in Month]) over (Intersect([Entity],AllPrevious([c.rowID])))

This gave me the desired response.