Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 3536 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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!

Posted (edited)

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

This topic is 3536 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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