Jump 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.

Calulation on each line of repeating field

Featured Replies

  • Newbies

I am presently trying to perform some black magic with repeating fields. I want to take a repeating field and output only certain lines of it based either on an inline variable (say, Char (1) = "$") or on a corresponding repeating table with true false values. Unfortunately my knowledge of filemaker scripting is quite shaky, and lacking traditional variables with which to increment my way through the series of lines (and any condition to stop on), I am rather stuck. The first character of any repetition after the first no longer appears to be 0. Maybe my fuzziness is theoretical. If logic in a repeating field is applied only in a lump sum, then everything I am doing is unhelpful (in retrospect this seems more obvious, but when you stare at something long enough nothing is clear any more.)

So my question is how do I parse though this series of lines outputting only lines that begin with $ (minus the $, but thats the easy bit).

Thanks in advance,

Conrad

Char(1) = "$" will NEVER return true. To get the first character of text, use =

Left ( text ; 1 )

  • Author
  • Newbies

Ok, well that explains why that fragment didn't work. (I guess you're saying char () is a casting function not a position one...?) I did however already try replacing that logic with a left() based one. Results were still unhelpful. I'll do some more playing around tomorrow when I can get my hands on the database again.

I guess you're saying char () is a casting function not a position one...?

No, I am definitely NOT saying that. I will say that you should get familiar with Filemaker functions and calculation syntax. I don't think I can say more than that, because I don't understand what you're trying to do (and why).

Conrad,

If you define a calculation field with the same number of repetitions as the repeating field you are trying to parse, then the calculations will be performed "slotwise" -- i.e. the nth repetition in the calculation will look only at the nth repetition in the text field.

So if you have a repeating field, and you want to identify which repetitions begin with the character "$", I think all you need to do is to define a calculation field (with the same number of repetitions) by Left ( yourfield ; 1 ) = "$". You will see that the calculation field appears as a row (or column) of 1's and 0's.

Generally if you have problems with repeating fields, you shouldn't be using them in the first place. With a standard item table, this would just be a find operation.

Create an account or sign in to comment

Important Information

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

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.