8 Replies Latest reply on Dec 4, 2018 2:25 PM by Randy Demaree

    First Day of Production

    Randy Demaree

      I have a large database filled with hundreds of wells, with documents for each day for each well.  I was curious if I could make a nice simple chart telling me each well and the first day that it produced oil.  At first I figured it would not be too hard, just give me the date of the very first document!  Unfortunately it is never that simple; each well is created before it starts doing anything and the documents are produced even though no values are being input.  (With the added potential of those first input values to be throw away values.)  So is there a way to find, for example, the first "document" for each well that the Oil is over 0 (figuring this is a good starting point that can be expanded from to solve most other issues of when something happened first.)

       

      Example:

       

      The end result would be the same colored well names and dates.  Roughly like this (Thanks paint!):

        • 1. Re: First Day of Production
          Joe Oppelt

          { FIXED [Well ID] : MIN( if [production amount] > 0 then [Date] END) }

           

          That will give you the min date where there is actual production.

          1 of 1 people found this helpful
          • 2. Re: First Day of Production
            Randy Demaree

            Thanks Joe for the quick reply,

             

            LOD would be great, unfortunately the database being connected to is through Access, which seems to not allow LOD expressions if I am not mistaken.

            • 3. Re: First Day of Production
              Joe Oppelt

              You'll have to translate that to your own actual field names, of course.

               

              And you might want to consider what to do with a negative number for output.  Even though the business rules say it can't happen, you can't count on data following the rules.  You might want to do <> (not equals) zero rather than greater than zero to catch that.

              • 4. Re: First Day of Production
                Joe Oppelt

                If you can't use LOD, then you'll use a table calc.

                 

                WINDOW_MIN( if SUM([production]) > 0 then ATTR([DATE]) END )

                 

                But that will put the MIN value on all dates for a given Well.  And you'll have to have all dates on the sheet for the table calc to evaluate across them.

                 

                Given the layout of your first screen shot, table(across) for the table calc setting would to the trick, but you might need to specify dimensions and a restart dimension to evaluate it from well to well.

                 

                Do you have a sheet layout in your example workbook where you want this displayed, and where would you like it displayed?  (I haven't opened the workbook yet.)

                • 5. Re: First Day of Production
                  Randy Demaree

                  The workbook just has the simple first table set up.

                  • 6. Re: First Day of Production
                    Joe Oppelt

                    See attached.

                    1 of 1 people found this helpful
                    • 7. Re: First Day of Production
                      Joe Oppelt

                      Addendum.

                       

                      If you want to display each well without displaying the individual dates, then see the attached.

                       

                      In copy 2 I dragged the date field to details.  Now you see that you get x-many marks per row, even though you're not displaying any value.  That's because the date pill forces marks.  And you need to have the date on the sheet like this for the table calc to evaluate each day's production.  So right click on the [First Production Date] pill on ROWS and select Edit Table Calc.  Here you can see that I selected individual dimensions, and told it to evaluate for each well along the date dimension (in that order) and to restart for each well.  Without this setting tableau was till doing table across, and each "across" is just each individual date for each well.

                       

                      So I still have 10 dots.  Go to Sheet 3.


                      Here I created a calc called INDEX and put that on filters, and set the table calc setting the same as the date calc.  Once it was set that way, I selected for index=1 and now we just see the first mark for each well.  (Since the table calc value is the same for all marks within a well, we only need to see one, and the first one is as good as any.)  If you look at the tooltips for each mark, you'll see that the actual date being displayed for each mark is Nov 10.


                      See attached.

                      1 of 1 people found this helpful
                      • 8. Re: First Day of Production
                        Randy Demaree

                        Awesome thanks.  Gets a little bulky with all the values from the database, but definitely works!