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

 

  • So for this the relevant portion of the correspondence file should probably be similar to:

    PASSING #4,TEST_RESULTS

    PointID,"<<HasData(<<TEST_RESULTS.Passing4>>,<<TEST_RESULTS.PointID>>)>>"

    Depth,<<TEST_RESULTS.Depth>>

    Passing #4,<<TEST_RESULTS.Passing4>>

    I assumed in the above that your source field name for passing number 4 was Passing4.  You will have to replace it with your actual source file name.  Also, the correspondence file tool will probably put quotes around the source expression for PointID but I don't think they are necessary in this case (can't hurt though)

    Sorry, I did not realize that you had PASSING #4 both as a table name and a field name and that the first line was actually the missing table header.

  • RE: Picture 1 missin table header, bad/ncompkeat field name SIEVE, duplicate target fields, referencing source for p200 to #4. Again use the tool

    RE missing table header, -- i did not copy and paste that section from the tool-created big correspondence file

    RE  bad/ncompkeat field name SIEVE  -  I think that Sieve you refer to ( in the first line of the correspondence snip) is not a Field Name but a Default Target 

    RE duplicate target fields - One of the Passing #4 is the Target Table, the other Passing #4 is a Field Name in that target Table. Yup - that can be confusing - I think I should name them not be NOT the same. 

    RE referencing source for p200 to #4. Again use the tool -  SMH on this one for sure. Much shame. Doh! Did use the tool, but got to hasty with my finger clicks.Joy




  • See my notes of shame and embarrassment in image below:

    EDIT -  after posting this and looking at more of your post  -- More shame. Thanks for pointing me in the right direction. 

  • Picture 1 missin table header, bad/ncompkeat field name SIEVE, duplicate target fields, referencing source for p200 to #4. Again use the tool

    Picture 2. In addition to errors if picture 1, you added has data to both pointID and depth, not necessary for depth and it us set to return PointID for the depth field. PointID us text, depth is numeric. That is why you got all the type missmatch errors. 

  • 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