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.

Help... Repeating field calculation only pulling first related record

Featured Replies

Hopefully I've posted this in the right place and someone can point me in the right direction here... 

I have staff and staffAllocations tables related by staffID. For each staff member I'm trying to visualise their events from the allocations table, displaying them in a row so that the user can easily see what events are allocated to them over the next 10 days. I'm using a repeating field (10 repetitions ) in the staff table with the following calculation:

Let (
[ current_date = Extend ( gview_startDate ) + Get ( CalculationRepetitionNumber ) ] ;
If ( current_date > Extend ( staffAllocations::dateStart ) and current_date < Extend ( staffAllocations::dateEnd ) +2 ; Extend ( staffAllocations::_eventID) )
)

...which works apart from the fact that it only shows one (the first) related record. It does pull the eventID into the appropriate repetition(s) depending on date range for the event but I can't work out why that calc wouldn't evaluated on all repetitions and therefore show all appropriate events... I'm trying to avoid using lots of portals and relationships to generate my summarised view of events so hope I'm missing something simple (or even something relatively complex..)

Any help or advice with this would be greatly appreciated!

In a calculation, a reference to a related filed is evaluated using data from the first related record. If you want the calculation to take into account all related records, you must use one of the aggregate functions, such as List(). However, Filemaker has no conditional aggregate functions (such as Excel's SUMIF(), for example).

I'd suggest you use either a filtered portal or a dedicated relationship to get only records within the desired range. If you decide to go with a filtered relationship, you can then use a repeating field to display the data instead of a portal - though I cannot see what advantage this would bring. On the contrary, it only adds undue complexity.

Edited by comment

  • Author

Thanks for the clarification and advice comment – I figured that might be the case and I'd be best just creating the required relationships.

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.