5 Replies Latest reply on Sep 23, 2010 4:52 PM by philmodjunk

    how to compare same field in different record?

    moonyounglee

      Title

      how to compare same field in different record?

      Post

      hi..

      I have  question about comparability.

      I want compare the data in same field between different record.

      for example..

      Field_A have "2" and Field_B have "Professor" at 1st record

      Field_A have "1" and Field_B have " Student" at 2nd record

      How can i compare "1" and "2" using function or script?

      I want to show "1 student" , "2 Professor " in same field.

      it's hard way to study filemaker..

        • 1. Re: how to compare same field in different record?
          philmodjunk

          I want to show "1 student" , "2 Professor " in same field.

          In same field of what record?

          How can you tell that these two records should be compared? (Professor teaches and student attends same class perhaps?)

          There are several approaches that can be used to compare values between records, the simplest is to just sort the records. But the best method requires that we know more about what you are trying to do here.

          • 2. Re: how to compare same field in different record?
            moonyounglee

            Thank PhilModjunk

            "sort" is not enough beause "sort" just show the results.

            I want to show or write the result in a field, like Field_C.

            in case of writing article, author's order is very important.

            for example, 1st author is moon-young lee, dds, ph.D student, 2nd author is sang-won lee, professor.

            I want to show the result form like " 1(superscript) moon-young, dds, ph.D student, 2(superscript) sang-won lee, professor " automatically.

            thus i must compare "1" and "2" in same field at different record.

            Student, professor is in same institute and write article with co-working.

            • 3. Re: how to compare same field in different record?
              philmodjunk

              My point here is that in order to know which records to "compare", some rules have to be established in order to identify which records should be compared in this way. The rule appears to be that they both are authors of the same article--though how you specify the order in which they are to be listed is not readily apparent.

              Say you have these three tables:

              Authors----<Author_Article>---Articles   (---< means one to many, many authors could write many articles. )

              Author_Article functions as a join table to support the many to many relationship implicit in your description of this issue. If you define a number field, Order, in Author_Article, to determine which contributor is listed first, you could define a calculation field, cOrderedAuthor that returns text which looks like this: Order & " " & Authors::AuthorName.

              If you specify a sort order for the relationship between Articles and Author_Article, this calculation in Articles would produce your sorted list of authors:  Subsitute ( List ( Author_Article::cOrderedAuthor ) ; ¶ ; ", " ).

              Final note: to get your superscript, you can use the TextStyleAdd function in cOrderedAuthor to specify a superscript style for the order value.

              • 4. Re: how to compare same field in different record?
                moonyounglee

                thank PhilModjunk

                i will try..

                thank you agian..

                • 5. Re: how to compare same field in different record?
                  philmodjunk

                  Here's a demo file of many to many relationships using a join table: 

                  http://www.4shared.com/file/PLhjErzu/Contracts_to_Companies.html