Jump to content

Filter records based on fields


Rewolfer

This topic is 4785 days old. Please don't post here. Open a new topic instead.

Recommended Posts

hello,

a fresh view by others might solve this in a minute.

table pict has an indexed field called xmp_index full of values containing broken down xmp descriptions of pictures in the form of

2008-01

Di

Europe

Germany

Hamburg

Leipziger Str. 39

Anna

Paul

- (every picture ends with a minus to satisfy empty search_part fields, see below)

table search (i like to save sets of searches) holds several fields which should filter those values with an AND-condition

search_part1 may contain "2008-01"

search_part2 may contain "Hamburg"

search_part3 may contain "-"

search_part4 may contain "-"

this would yield all pictures that where shot in hamburg in januar 2008. so far it works. if i now add a fifth field with a ISNOT-condition to the relation

search_part5 may contain "Anna"

the result is always empty except i set search_part5 to something unusual like "§" (values definitively not in xmp_index). i thought, adding the NOT-condition would show me all pictures taken in hamburg in januar 2008 excluding those with Anna. am i thinking in the wrong direction?

thanks in advance for your help,

sheldon.

filter.png

Link to comment
Share on other sites

I am not sure I follow your description fully, esp. the part about "every picture ends with a minus to satisfy empty search_part fields".

I think you want to find records containing the words "2008-01" AND "Hamburg" BUT NOT "Anna." For this, you should have 2 requests: one to find 2008-01 Hamburg and one to omit Anna (note that ≠ is not a search operator).

However, I would suggest you re-think your entire approach and stick to the one fact per field rule. Right now it looks like you are throwing all your needles into a haystack, then ask how to look for them.

Link to comment
Share on other sites

if you look at my first attachment png you will see my condition for this relationship is

search_part1 AND search_part2 AND search_part3 AND search_part4 is true for xmp_index

if any of those search-fields would be left empty it would return only pictures which have no xmp_value at all. in my case none.

that's why: empty search_part-fields will be filled with an "-" so the AND-clause will default to true since every picture has a "-" in its xmp-index.

my question is more about filtering the relationship than finding. i'm using a portal to view my pictures. no scripts or perform-finds involved here. only saved searches. in fact it works more comfortable like this:

1 field called search_phrase will be parsed into 4 fields (search_part1,2,3,4) thus filtering the pool of pictures. the advantage of several fields is: lists in any of those fields work as an OR-operator. a sort of saved google-search. and your right: i want to accomplish an effect like "give me thru a relationship records with value A and (B or C or D) and E but not F". i cannot bring the "but not F" to work.

i know, i could filter the portal in FMP11 but i want to save the list of IDs this relationship yields.

i attached two more pictures to demonstrate my case.

search_part1 ==> "switzerland"

search_part2 ==> "tarek"

search_part3 ==> "2009¶2010¶2011"

search_part4 ==> "-"

will yield 67 pictures (any pictures of the year 2009 or 2010 or 2011 that were shot in switzerland with tarek in it).

if i add condition search_part5 ≠ xmp_index to the relationship

search_part5 ==> "Sa" (exclude Saturdays)

the result is empty.

something trivial must elude my mind, grhhh,

thanks for any replies,

sheldon.

4xAND.png

4xAND1xNOT.png

Link to comment
Share on other sites

thanks for proving to me that it is possible. your solution is quite similiar to mine and exactly how i expected filemaker to work.

mh, i must have done something different/ forgotten something. i'm counter-checking…

thanks for your reply,

sheldon.

Link to comment
Share on other sites

if found my blunder! there was nothing wrong with the relationship. but i didn't error-check the parsing into the conditional fields. so the ISNOT-condition could end up in an ISEQUAL-condition.

thanks for your help,

sheldon.

Link to comment
Share on other sites

Not every relationship is suitable for creating records, esp. when one of the predicates is 'not equal to [something]'. With an 'equal' predicate, Filemaker can easily conform by entering that [something] into the matchfield of the new record; but with 'not equal' - should it just make up a value?

Link to comment
Share on other sites

This topic is 4785 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.