Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Filemaker compare attributes

Posted on 2013-05-13
4
Medium Priority
?
382 Views
Last Modified: 2013-12-14
Note that I have also posted this in another forum:-

http://forums.filemaker.com/posts/019a1d406a

I am trying to build a FM12 database for a dating agency,

Each person on the database has two characteristics that they select from a drop down (e.g Honesty, Sincerity, Caring, Vareity, Intelligence).

So Person 1 might select Honesty and Vareity for their chosen values. Person 2 might choose Vareity and Sincerity. So they have one common characteristic. Essentially I am trying to count the number of common characteristics between any two people in the database.

So far whatever method I have tried has given correct values from one side of the match but not the other. E.g if I compare person 1 and person 2, when I look at person 1 from person 2's profile I get the correct result, However if I look at person 2 from person 1's profile I get the wrong result.
0
Comment
Question by:Kap68
3 Comments
 
LVL 25

Accepted Solution

by:
Will Loving earned 2000 total points
ID: 39161473
One way to do this is to use the FilterValues( ) function. In FileMaker terms, "values" in a field means the content of each line in a field separated by a carriage return. So, for example, the list:

Apple
Banana
Orange

contains three values, one for each line. Using the FilterValues( ) function you can compare two lists and find the common values. You can also use the ValueCount( ) function to count the number of values in a list.

In your example, it sounds like you have five separate characteristic fields. In order to compare the characteristic lists of two people and find the common values,  you'll first need to create a calculation field that makes list of a person's characteristics  using the List( ) function. A calc field called CharacteristicList might look like this:

CharacteristicList =
     List( Char1 ; Char2 ; Char3 ; Char 4 ; Char 5 )

The calculation result of this field for one person might look like this (I'm making up some other possible characteristics since I don't know all the values in your menus) :

Honesty
Sincerity
Active
Family
Sports

Another person might have a very different list such as:

Intelligence
Quiet
Sincerity
Family
Theater

Assuming you already have a way to temporarily relate two individuals (setting a global field with the other person's ID or creating a record in an intermediary table that relates both people to each other) you can use the FilterValues( ) function to find the common traits.

     FilterValues( PersonA::CharacteristicList ; PersonB::CharacteristicList )

The result of comparing the above two lists would be:

Sincerity
Family

To count the number of common traits, use:

     ValueCount( CharacteristicList )  

which in this case would = 2

For additional information on the FilterValues( ) function, see this FileMaker Help article:

https://www.filemaker.com/12help/html/func_ref3.33.53.html

and also this more general article:

http://www.dwaynewright.com/filemaker-thoughts/2010/12/19/filter-and-filtervalues-explored.html

In addition, if you have FileMaker Pro Advanced and therefore the ability to install Custom Functions in your database, there are a number of Custom Functions that can greatly enhance your ability to compare lists. Here is one example.

http://www.briandunning.com/cf/771
0
 

Author Comment

by:Kap68
ID: 39161601
Thanks - I am getting closer - this has helped enormously but I seem to get strange results occassionally.
0
 
LVL 8

Expert Comment

by:Tocacar
ID: 39718586
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question