0

Nested NL filter on field in table with multiple rows

Hi Guys,

I have done a quick search but wasn't really sure how to word the problem.

What I am trying to do, is run an NL function to get all rows from a table where 3 fields are filtered on.
I also want to link to another table to add another filter. The problem is, the table I link to has multiple rows that are linked to the row from the primary table.
I want to exclude anything where there is a row with a field that is equal to a value.

I now it's not very well explained, so let me show you the code:
=NL("Rows","job-hdr",,"job-dept",$C$2,"job-date",$C$3,"address-code",$C$4,"Link=","job-line","job-id","=job-id","cargo-desc","RICE","Link=","doc-adds","job-id","=job-id","address-code","<>BOND09")
As you can see, I am getting rows from the "job-hdr" table, where the "job-dept", "job-date" and "address-code" are filtered on.
I then link to the "job-line" table using the "job-id" as the link, which allows me to get only rows where the "cargo-desc" equals "RICE".
The second link is to the "doc-adds" table, again using "job-id" as the link.
You can see I want to exclude anything where the "address-code" in the "doc-adds" table does not equal "BOND09".

The issue is, in the "doc-adds" table, there are normally about 4 rows for that job-id, and only one will ever be BOND09.
So how can I exclude rows from the primary table (Job-hdr), if there are ANY rows in "doc-adds" which have an "address-code" of "BOND09"?

Hopefully that makes sense and i'm sure this will be simple for most.
Thanks for any assistance offered.

Eds

6 comments

Please sign in to leave a comment.