Query about counting specific information in portal

Discussion created by mdc91 on Mar 24, 2017
Latest reply on Mar 25, 2017 by philmodjunk

Hi there,


Please excuse this if it is a bit of a newbie question.


take this as a portal table (Assigned Services) in my main database (Bookings):




In a standard booking there will be 3 members of staff, and an optional assigned product is an extra member of staff.

In my bookings table I'd like to have a row with the total amount of staff needed.


In plain english my function would be:


If no "additional staff  product" present in Assigned Services portal then total staff needed = 3


if "additional staff product" is present in assigned services portal then the sum would be: Qty of Additional staff (from portal row) + 3 = x


How would I write a function to calculate this?