June 30, 200817 yr Newbies I would like to set serial numbers for a subset of records. First, I sort all the records with two criterias, so that the records with the same entry in the first sorting criteria are grouped together. I name them 1st-criteria-groups. Then I would like to set serial numbers (1,2,...) for each individual 1st-criteria-group. I know how to build a script that sorts with two criterias. But I don't know how to generate serial numbers, that always start over again.
June 30, 200817 yr With relational databases are serial numbers serious business, which yours frankly can't be. You seem to wish for a numbering to a relative position in a listing. You need to explain what kind of listing we're talking about here, what is the purpose of these serial numbers, what are they "in the eye of the beholder"? Are we talking summaries, portals or something third here? --sd
June 30, 200817 yr Author Newbies Sorry, for not being clear enough.... Yes, I'd like to do a numbering to a relative position in a list. The records are listed and sorted in a portal. I would need the serial numbering in order to display in another portal only the "top two" records of each subset. I appreciate any help / ideas !! dama
June 30, 200817 yr The records are listed and sorted in a portal. Try this just ahead of the first field in the row, do in layout mode type in a @@ ...and see if it fits the purpose? --sd
June 30, 200817 yr Author Newbies The @@ gives me a numbering through all the records in the portal, but the numbers don't start at 1 again, which each new 1st criteria. Maybe to explain better: Assuming I have two rows like that: a - 10 a - 5 a - 1 b - 10 b - 5 b - 1 ...and then want to have serial numbers like that: a - 10 - 1 a - 5 - 2 a - 1 - 3 b - 10 - 1 b - 5 - 2 b - 1 - 3 ...in order to display in another portal only records with serial nr. 1 and 2: a - 10 - 1 a - 5 - 2 b - 10 - 1 b - 5 - 2
June 30, 200817 yr It's done by putting a calc'field in the portal records table using: http://www.filemaker.com/help/FunctionsRef-39.html If the same field in the row above is a different category in a Case( or If( statement use "1" else the value from above+1 .... --sd
June 30, 200817 yr The numbering part is easy: define a summary field in the child table as running count of ChildID, with restart when sorted by category. Then place this field in the portal. However, you cannot use this field to isolate the first two records in each category for the purposes of a relationship. That's a completely different issue.
Create an account or sign in to comment