5 Replies Latest reply on Jul 18, 2012 10:44 AM by philmodjunk

    Serial Numbers for Duplicates Fields

    xfz

      Title

      Serial Numbers for Duplicates Fields

      Post

      Hi All,

      I'm pretty new to filemaker. Please excuse my ignorance.

      Let's say I have a field like so:

      Col1 

      asdf

      asdf

      asdf

      qwer

      qwer

      qwer

      qwer

      zxcv

      zxcv

      zxcv

      zxcv

       

      How can I add a field with serial numbers, with the serials starting over at 1 each time the row above is different:

      Col1     Col2

      asdf      1

      asdf      2

      asdf      3

      qwer     1

      qwer     2

      qwer     3

      qwer     4

      zxcv     1

      zxcv     2

      zxcv     3

      zxcv     4

       

       

      Thanks

        • 1. Re: Serial Numbers for Duplicates Fields
          RickWhitelaw
          It seems you're dealing with a number of fields. Are these fields part of one record? Perhaps they shouldn't be. I'm shooting in the dark here because I don't really understand your post!
          • 2. Re: Serial Numbers for Duplicates Fields
            xfz

            Hi Rick,

             

            I want to end up with two fields.

            1 field is an abitrary name, the other field contains the serials.

            In table view:

                       | field1   | field 2 
            -----------------------------
            record 1    |  asdf      |  1
            -----------------------------
            record 2    |  asdf     |  2
            -----------------------------
            record 3    |  asdf     |  3
            -----------------------------
            record 4    |  qwer    |  1
            -----------------------------
            record 5    |  qwer    |  2
            -----------------------------
            record 6    |  qwer    |  3
            ------------------------------
            record 7    |   qwer    |  4
            ------------------------------
            record 8    |  zxcv     |  1
            -----------------------------
            record 9    |  zxcv     |  2
            -----------------------------
            record 10  |   zxcv    |   3
            -----------------------------
            record 11  |   zxcv   |   4
            serial numbers to start over at 1 whenever a record in field1 is not the same as above record in the same field
            This is a SQL implementation
            http://www.sqlservercurry.com/2012/03/reset-row-number-for-each-group-sql.html 
            • 3. Re: Serial Numbers for Duplicates Fields
              philmodjunk

              How you will you use this number?

              If it's just to number a list of items in a report, a summary field with a running total setting can be used to produce this number sequence.

              • 4. Re: Serial Numbers for Duplicates Fields
                xfz

                Hi Phil,

                I made a summary field with a running total. The result was that the numbering was sequential for all of the records, instead of reseting the count when I got to to a new group

                • 5. Re: Serial Numbers for Duplicates Fields
                  philmodjunk

                  Not if you use the "Restart summary with each sorted group" option to reset the count with each new group. Your field 1 would be the "sorted by" field used for this.

                  The key limitation here is that your records must be correctly sorted in your current found set in order to get this number sequence to be correct.