Jump to content

Trying to start a forward date column keying off another column


Paul Sanchez 2

Recommended Posts

Hi,

I have a column that goes to the beggining of the month if a well starts producing before or on the 11th of the month, and to the beggining of the next month if the well starts producing on the 12th or after.

 

For example. Production date 3/10/2018, my column starts the well production at 3/1/2018. I need a column that keys off of the 3/1/2018 and enters 3/2/2018 the next day, 3/3/2018 the next and so on.

Aries Prod Date Aries Calendar Date

3/1/2018 3/1/2018

3/1/2018 3/2/2018

3/1/2018 3/3/2018

I'm trying to implement a column that does what "Aries Calendar Date" does. It needs to key off of the Aries prod date for different wells.

case

WHEN [ARIES DATE] IS NOT NULL THEN

DateAdd("DAY",+1,[ARIES DATE])

END

The above formula is just giving me 3/2/2018 over and over. I think I need a PREVIOUS or a PREVIOUS NODE

Any help would be greatly appreciated.

 

Thank you!

Link to comment
Share on other sites

I would accomplish that with two calculated columns, assuming in your requirements that in the Aries Calendar column you have consecutive days that key off the Aries Prod Date (eg. 3/1/2018)

a) Create a calculated column (Aries_RNK) that creates a set of consecutive numbers from 1 on the first day ... I will do that using a Rank function : Rank([Aries_Prod], "asc", "ties.method=first")

b) Create another column (Aries_Calendar) using this new column as parameter to add days to the First Production date. However, I keep this first date constant using ValueForMin function: DateAdd("day", [Aries_RNK]-1, [Aries_Prod]))

Note: I use a -1 on (b) above to shift the dates so that dates still match on first day. Also, you may need to use the Over function in a) above to group the ranking by wells.

Result:

Aries_Prod RNK Aries_Calendar

3/1/2018 1 3/1/2018

3/1/2018 2 3/2/2018

3/1/2018 3 3/3/2018

Hope this helps

Gerald

Link to comment
Share on other sites

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...