0

Inserting Table into Formula

Is it possible to insert a sub-table (columns & rows) into a Formula field and have it visually identical to the sub-table itself?  I have 2 tables that I need to input as well as the rest of the summary data but every time I try to move sub-table data into the Formula field I end up with the values being displayed as a run-on sentence, or average, or gibbersh, etc instead of it looking like an actual table.  

 

I apologize for the crudeness/simplicity of my design, I don't write code.

Here is what I have written so far.  I have italicized and set in bold the lines that will be removed once I figure out how to insert the sub-table.

 

"STAGE " + 'Stage #:' + " OF " + 'Total Stages:' + " P&P" + "
" + "
" + ("RIH WITH DYNA ENERGETICS 2.750"" PERF GUNS, WBX2, CCL, DISCONNECT, SETTING TOOL 4 SPF, 24 SHOTS .375 EHD 60 DEG PHASE 20"" CARRIER 15 GM CHARGE " + "
" + "
" + "CORRELATE WITH PBR/XO @ ") + 'Liner Top:' + " AND MAKE " + Correction + " CORRECTION" + "
" + "
" + "PUMP-DOWN TIME: " + 'PD Time:' + "
" + "xxx insert pumpdown table here xxx" + "
" + "
" + "MAX RATE - " + 'Max Rate (BPM)' + " MAX PRESS - " + 'Max Pressure (PSI)' + " VOLUME - " + 'Total Volume (BBLS)' + "
" + "
" + "SET " + Plug + " @ " + 'Plug Set Depth' + " WLMD" + "
" + "PRE-LTEN " + 'Pre - LTEN' + " POST-LTEN " + 'Post - LTEN' + "
" + "
" + "PERFORATIONS:" + "
" + "xxx insert perf table here xxx" + "
" + "
" + "POOH @ " + POOH + "
" + "SIP " + 'SIP:' 

7 replies

null
    • Walt_Baker
    • 4 yrs ago
    • Reported - view

    I fixed it for now.  I created a Formula that displays both of the items in each line of the sub-table and then in the Summary above I had it display the range function of the sub-table and it puts everything in place.  I'm sure there's an easier way, but this one works.

    • Walt_Baker
    • 4 yrs ago
    • Reported - view

    "STAGE " + 'Stage #:' + " OF " + 'Total Stages:' + " P&P" + "
    " + "
    " + ("RIH WITH DYNA ENERGETICS 2.750"" PERF GUNS, WEIGHT BAR X 2, CCL, BRT DISCONNECT, #10 SETTING TOOL 4 SPF, 24 SHOTS .375 EHD 60 DEG PHASE 20"" CARRIER 15 GM CHARGE " + "
    " + "
    " + "CORRELATE WITH PBR/XO @ ") + 'Liner Top:' + " AND MAKE " + Correction + " CORRECTION" + "
    " + "
    " + "PUMP-DOWN TIME: " + 'PD Time:' + "
    " + 'Pump-down'.'Rate & Pressure' + "
    " + "
    " + "MAX RATE - " + 'Max Rate (BPM)' + " MAX PRESS - " + 'Max Pressure (PSI)' + " VOLUME - " + 'Total Volume (BBLS)' + "
    " + "
    " + "SET " + Plug + " @ " + 'Plug Set Depth' + " WLMD" + "
    " + "PRE-LTEN " + 'Pre - LTEN' + " POST-LTEN " + 'Post - LTEN' + "
    " + "
    " + "PERFORATIONS:" + "
    " + 'Perforation Schedule'.Range + "
    " + "POOH @ " + POOH + "
    " + "SIP " + 'SIP:'

    • Sean
    • 4 yrs ago
    • Reported - view

    Nice work! I'm trying to understand what you did here. Are you saying you used a separate formula field to build the table data and then inserted it into your summary formula? I don't understand this statement... "in the Summary above I had it display the range function of the sub-table".

     

    I've done something similar using the html() function.

    • Walt_Baker
    • 4 yrs ago
    • Reported - view

    In the sub-tables I have two columns from which I need data displayed in the Summary.  I created a Formula field in those sub-tables that combine the data from the two columns in text form into a single field.

    These are the Formulas within the sub-tables:

    text('Cluster Top') + " - " + 'Cluster Bottom' + "
    "

    &

    text('Rate (BPM)') + " @ " + 'Circ Press (PSI)' + "
    "

    I then referenced those fields in the main table Formula using the range function and it combined them (spacing wasn't hard to figure out" and then displayed them sequentially right where I wanted them.

     

    This is what the main table looks like with the two sub-tables inset and where I input my data.

    Screen Shot 2019-05-28 at 09.45.31

    This is the Summary I get from that Table:

    Screen Shot 2019-05-28 at 09.46.21

    There's probably a simpler way to do it, I just did it the only way I knew how.  First time trying to code.

    • Sean
    • 4 yrs ago
    • Reported - view

    I'd say well done for your first time. I am familiar with the range() function, but I'm still not understanding your use of it here.

     

    This is unrelated to the coding, but apropos to your location... It's astounding the Denny's failed at the Flying J in Pecos when you consider all of the traffic in the region!

    • Sean
    • 4 yrs ago
    • Reported - view

    I'm rephrasing my question. In the line...

     

    " + 'Pump-down'.'Rate & Pressure' + "

     

    I don't understand how you are getting rows of information without using a for-loop. This is what I have to do to get rows of information in a formula field...

     

    let myRow := "";
    for r in Vendor do
    myRow := myRow + r.Name + " " + r.Address + "
    "
    end;
    replace(concat(myRow), ", ", "")

    • Sean
    • 4 yrs ago
    • Reported - view

    Nevermind, I figured it out.

Content aside

  • 4 yrs agoLast active
  • 7Replies
  • 1724Views