Correspondence Files: How to suppress display of Records having no data in a field

I am working with source file that has a Lab Results table that has Fields for minus#4, minus#40  % passing data, AND also has other data fields  eg Mositure, etc.

I an trying to suppress the display of records for the minus#4, minusXYZ, et al, that have no value for that test. For example where there is no test result data element for that minus#4, etc  My correspondence is however, bringing in all the depths in the table, even thought there is no minusXYZ data. Yes, there is Moisture data etc, and that is why the source has all these "spurious" depths, and, of course, they are coming in because they indeed are in the source table.

Can I suppress these "blank" rows through correspondence file code.

If not, I can rewrite the external code to push the minus#4, minusXYX, et al,  to a separate source table having only that data, but I would like to put the "how to do it in giNT" in my toolbelt too.

Ideas??

 

Parents
  • Doing this by memory so may have syntax wrong. In general, if the key field is not populated, the record will not be imported. Thus for your correspondence file the key field of PointID should be

    PointID,<<HasData(<<TEST_RESULTS.M200>>,<<TEST_RESUlTS.PoibtID>>)>>

    This will return the pointID if there is data in the m200 field and nothing if there us no data in the m200 field. If the pointID us not populated, the record will not be created and no other data will be imported (depth] even if it exists. The rest of your lines can be simple 1 to 1 correspondences. 

  • In the line below:

    PointID,<<HasData(<<TEST_RESULTS.M200>>,<<TEST_RESULTS.PointID>>)>>

    is that comma "," an "OR" operator? The expression <<HasData(<<TEST_RESULTS.M200>>,<<TEST_RESULTS.PointID>>)>> is a Boolean. Does the statement mean  If either  <<TEST_RESULTS.M200>> has no data Or <<TEST_RESULTS.PointID>> has no data, then the expression evaluates to false and this dual condition causes the underlying correspondence code engine to skip the record? I assume no data id the "Null" condition.

Reply
  • In the line below:

    PointID,<<HasData(<<TEST_RESULTS.M200>>,<<TEST_RESULTS.PointID>>)>>

    is that comma "," an "OR" operator? The expression <<HasData(<<TEST_RESULTS.M200>>,<<TEST_RESULTS.PointID>>)>> is a Boolean. Does the statement mean  If either  <<TEST_RESULTS.M200>> has no data Or <<TEST_RESULTS.PointID>> has no data, then the expression evaluates to false and this dual condition causes the underlying correspondence code engine to skip the record? I assume no data id the "Null" condition.

Children
  • The HasData function has 3 arguements, each is separated by commas. The first arguement is the field to check if you have data, the second arguement is what to return if the field has data, the third is what to return if the field doesn't have data. In this case I only used the first two arguments because we want nothing returned if there is no data. If only the first field is used, it returns a boolean. 

    When used in the pointID field it will the point ID which is what we would normally want but only if your passing 200 field has data. When your passing 200 field doesn't have data, this returns nothing for the pointID field. Since a data structure  requires a key field to link your tables together, the record is not created when the key field is empty. 

    Note you will have to modify this for each specific table you are using it on. If you use the correspondence file creation tool in gINT, it will help you avoid misspelled field names and missing delimiters or parenthesis

    Your correspondence file appears to be missing the table heading and corresponding default table. Again yes the tool to get the file format correct and complete. 

    Again I will stress that you only need the hasdata expression for the PointID field. The rest of the fields can simply point to the correct field in the source file. 

    Answer Verified By: Art Koenig