Place a text string if certain conditions are met

It sounds easy, but it has proven not to be.

In my report, I'd like to have a text string and value appear when we drive SPTs in a boring.  Here's what the report looks like with an SPT drive at the bottom.

When an SPT is driven, I'd like the area in the header to say Hammer Correction Factor = <value> where the "yyy" is located.

Here's how some of my tables appear:

<<PROJECT>>

<<BOREHOLE>>

<<BOREHOLE.Sample>>

In this example, CH1 has some SPTs.  The HCF is 83.5.  CH2 (not shown) does not have any SPTs.  On the project sheet, there's a box utilized for calculating N60.  I cannot key to that, because its part of the Coordinate Fields in the Tables menu.  If there's a way to link to it, this would seem to be the most straight forward, but the option doesn't even seem to exist when I try. 

On the Borehole Tab, there is nothing which denotes the types of samples taken in the hole.  I'd like to avoid adding anything in there, but it is a possibility. 

I don't know if I could do a search in a range on the Samples tab.  Check the HCF column and if any data appears, place the text.   I'd just have no idea how to code that.

Anyone got any ideas?

  • Hi Jeff,

    There are many different ways that you could set this up, and there might be good reason to set it up one way vs. another. But, here's one potential solution.

    Also, the way your database is set up, it is possible that you could have different HCF's for different samples in a single borehole. This could happen if you swapped a hammer or drill rig mid-hole. To keep things simple though, I'll assume there's just one HCF for each borehole.

    In which case, you could use the following as the Text Expression in your Text Entity:

    <<DelimitData(_
      Hammer Correction Factor = ,_
      <<Max(<<SAMPLE.HammerCorrectionFactor>>)>>,_
    )>>

    The DelimitData() function will only print "Hammer Correction  Factor = " if the second argument using the Max() function returns a result. If no HCF is entered for that borehole, no HCF will be returned and nothing will print. For more info, see the Help Articles on DelimitData, Max, and Aggregate Functions.

  •  Simple way is to use the count function.  Your sample table contains a field for blows 1st.  Simply count the number of values in that field and if it returns zero don't print the entity for ER. Specifically, place something like the following in the output condition of the ER text entity.

    <<count(sample.blows1)>>

    If it returns zero this is false and the entity will not print.  If it returns any value greater then zero, this is true and the entity will print.  For greater clarity you could write

    <<IIf(<<count(sample.blows1)>>=0,False,True)>>

  • This would provide gINT the ability to know when to output the hammer efficiency, however, it doesn't provide a mechanism for telling the log what the hammer efficiency is.  Jesse's solution is probably the best code solution. The best solution would be adding a lookup table for Borehole so that the rig efficiency is hardwired into the library with the rig selected.