AnsweredAssumed Answered

Exclude a record from report

Question asked by sansae on Dec 27, 2016
Latest reply on Dec 28, 2016 by BruceRobertson


I found this thread from 2013:

Want to exclude a record with empty fields from a report


I'm trying to do the same thing. I took the suggestion of using Constrain Found Set[], but my script isn't working as expected.

What I want is to exclude from my report any records that have an invalid zipcode field. That is to say, a zipcode that does not have 5 numbers (e.g. 12345). There is a script function called "isEmpty", which I'm sure I can use to successfully exclude records whose zip fields are empty, but what if the zip field contains a space, " ", or carriage return, etc. (note: there are several records in my db that have such values in the zip field; i'm not supposed to delete those records, but rather ignore them in my report).


Here's what I have:

Set Variable [ $ListZips ; Value: List ( table_occurrence :: zip_field) ]

Constrain Found Set [ Restore ]


Restore has this field:

table_occurrence :: zip_field


and this criteria:

$ListZips = "#####"


In Data Viewer, $ListZips shows me my zipcodes.

My thinking is that I can constrain that set of zipcodes with the criteria of "#####", or 5 numbers (which represent a valid US zipcode).

However, this doesn't work and I am getting the "no records match this find criteria" error.


I just want to exclude/ignore/"make disappear from my found set (but not from the database)" records that do not have a valid zipcode.


Is there a script function that will allow me to exclude such records?

Can anyone help me?


Message was edited by: San Sae added more info