Batch Numbers

Discussion created by melcam on Nov 5, 2014
Latest reply on Nov 7, 2014 by melcam

I am just starting to use filemaker, and am trying to create a solution which will import a file, sort it based on the SKU field, and then assign a batch number to all the records with matching skus. The idea was that all records imported from the file would have the same batch number, the next time the script runs it would assign the next number up (IE file x=batch 1, file y=batch 2, file x=batch3), and each batch would be divided into subgroups based on the SKUS (so it would be like this batch 1-sku1, batch 1-sku2, etc). There are up to 80 different possible skus, so I would like to not have an if statement for each one. I was thinking I could use the "repitition" part of the replace contents action and have the calculation check if the SKU from the current record is equal to the sku from the last record. If they were not equal it would start the next serial number. I'm just wondering if it is possible to do it this way or if I should try a different method.


So I have two questions: Is it possible to assign batch numbers which will always be unique, and is it possible to assign all records with the same SKU an ID with out using individual if statements.