Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Confusing Calculation

Featured Replies

hello all ... i work with a photography company and i am looking to create camera cards ... i am currently using filemaker as my primary database program ... The "Camera card" is an 8.5x11 sheet that will display 9 records on it ... this is relativly simple... but here is the catch ... i need the records to be sorted very oddly before printing ... see the attached three images to better explaing what i need. Lets just say that my database has 27 records for sanity's sake. on the cards i need the records to be printed "stacked" what i mean is that on page 1 the first record should print is the first of the nine slots. (see attached) however ... the second record needs to be in the first place on page two. ,, likewise for the third record. needs to be in the first place on page three. This may be all two confusing ... but i am totally lost .... the only way i see this possible it to create a sort field ... then fill it with a calcualted result. that calculation being something like "number of records" divided by 9 - that will get me the total number of pages that will be used in the printout ... then fill with a serial number starting at 1 and increasing by the total number of pages .... maybe thats not the way to do it ... please let me know if you have any ideas

fm1.jpg

-----------------------------------------------------------

-----------------------------------------------------------

-----------------------------------------------------------

fm3.jpg

-----------------------------------------------------------

-----------------------------------------------------------

-----------------------------------------------------------

fm2.jpg

You will need a field to serialize your records. Let's call it "SN". And then another one for a page count. Let's call it "Pages" (which contains the value of current record count divided by 9). Assume that SN contains the photo numbers. You can make a sort field "SortOrder" with this calculation:

9*Mod(sn-1;Pages)+Int((sn-1)/Pages)+1

Then sort on the SortOrder field.

This should work when the number of records is an exact multiple of 9, but I don't know how you want to handle less than exact multiples.

<<Edit: I had the formula backwards. Fixed it.>>

I hope Bob doesn't aim that cannon at me for this. wink.gif

You can replace Int((SN - 1)/9) with Div( SN - 1; 9 ), and there is a missing ending parenthesis.

  • Author

i need 3 things then ... How can i get "(which contains the value of current record count divided by 9)"

how do i get the SN field to contain the Current record number

how can i automaticly add (how ever many) records needed to make it exact multiples of nine?

Hi Queue,

Actually, I realized after I posted, that the formula I gave would give the picture sequence, 1, 4, 7, 10, 13, 16... etc., which is not the same as the sort order which is in fact 1, 10, 19, 2, 11, 20... etc. I edited the formula in the previous post before I saw your reply. Still being new to FM7, I wasn't familiar with the DIV function.

Tallboy, you can do this with a script:


**Add records to make exact multiple of 9

Loop

  Exit Loop If [  not  Mod ( Get ( FoundCount ) ; 9 ) ]

  New Record/Request

End Loop

** Count pages

Set Field [ Pages; Get ( FoundCount )/9 ]

**Set the SN field Equal to the record number

Replace Field Contents [ sn; Replace with calculation: Get ( RecordNumber ) ] [ Update Entry Options ] 

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.