manitobaangler Posted April 9, 2002 Posted April 9, 2002 I'm producing a catalog with FM as the intermediate database to do any necessary data calcs. To make a long story shorter I end up sending the page number each item is on back to the FM solution from the produced catalog. This allows me to create a Table Of Contents and Index within FM. Now, if we were allowed to sort the records in the catalog in a logical fashion such as by category and subcategory producing index and TOC are no problem. What's happening though is that a custom sort order is required based on favoritism to particular providers etc. So, for example, subcategory A may have items appearing on page 2, 5, 6, 7, 20, etc. Both TOC and Index are required to display the starting page of each group. ie: 2, 5, 20. Initially before the custom sort occurred I had a layout in FM for both TOC and index. In the case of the TOC (index is similar), the layout parts consisted of Header, Sub-summary (sorted by category) w/category field, Sub-summary (sorted by subcategory) w/subcategory & page number minimum summary as merge fields, Footer. This listed just the first page these items were on. I need the running list of all the page numbers for the subcategory. I've tried using portals to display all records for a subcategory. I haven't succeeded yet in using the displayed data, it's a real pain. Right now I'd settle for listing all page numbers each sub-summary occurs on. I guess I'm looing for a calc that will identify all unique values of a particular field within a found set. Idea's? [ April 09, 2002, 12:36 PM: Message edited by: manitobaangler ]
slstrother Posted April 9, 2002 Posted April 9, 2002 There is a tip file at Database Pros that might help. I modified it to work with my database. Hopefully you are running on a MAC, because I have run across some problems with the number of pages in preview being different than the number of pages printed. The tip file is here Create a Index Hope this helps
manitobaangler Posted April 10, 2002 Author Posted April 10, 2002 Thanks slstrother, but, the link didn't help. I've already got the page numbers as part of each record. My problem is getting the multiple values (page #'s) for each subcategory combined into one field. I can't believe this is sooo difficult. I would have thought other people would run into this occasionally. Am I posting in the wrong forum?
Gogargirl Posted April 10, 2002 Posted April 10, 2002 It's a little difficult to work out from your initial post what structure you're working with. What are your records? Are they topics? Are you working with one file or related files? Are you saying that you want the TOC and Index to be dynamic, depending on the custom sort order? A little more info and we'll get you sorted!
manitobaangler Posted April 12, 2002 Author Posted April 12, 2002 Essentially, I've got a number field. it's got a bunch of values, say 2,3,4,15,16,20,22 (one number value per record) I want a way to get the first number in each series into the same global field as a new series: 2,15,16,20,22 ( all unique values, as string in single global field) Does the summation here clear it up?
slstrother Posted April 12, 2002 Posted April 12, 2002 Let's see if I understand what you have. You have several categories, each category contains several records, each record has a page number field. As an example: Category A Record1 - Page Number=2 Record2 - Page Number=5 Record3 - Page Number=10 Record4 - Page Number=15 Then you want all of the page numbers from Category A in a global field as 2, 5, 10, 15 Then you want the same for each of the other categories. If this is correct, you will need to set up a script for each category as follows: Perform Find[Restore, Category=Category A] Sort[Restore,Page Number, Ascending] Go To Record/Request Page[First] Set Field[gPageNumbersA,Page Number] Loop Go To Record/Request Page[Exit After Last, Next] Set Field[gPageNumbersA, gPageNumbersA&", "&Page Number] End Loop Of course you will need to set the find and sort criteria before creating the script. Hope this helps
Fitch Posted April 12, 2002 Posted April 12, 2002 I think manitoba's already got the page numbers, but is needing help isolating the first page of each consecutive range. Try this: Make a new global, gCompare. Then run this script: Go to record [first] Set field [gSeries, pageNumber] Loop . Set field gCompare [pageNumber] . Go to record [next, exit after last] . If [value > (gCompare + 1)] .. Set field [gSeries, series & ", " & pageNumber] . End If End Loop
manitobaangler Posted April 18, 2002 Author Posted April 18, 2002 Thanks slstrother, Fitch. It ended up I needing both of your suggestions. The final scripts ended up being waaaaayy more complex than your suggestions but the basic idea's were there. Just wish there'd have been a calculation to find unique values of a given field within a found set to do this instead of scripting. Anyways, it looks like it's a done deal, so thanks again.
Recommended Posts
This topic is 8326 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now