AnsweredAssumed Answered

Calculated fields with clauses

Question asked by Frederik Lundberg on Mar 27, 2019
Latest reply on Apr 2, 2019 by B_Canales

I am setting up sugarCRM for a real estate administration company..


I have used the accounts module for buildings and apartments..
Each apartment is a member of the building they are in..

I have made a calculated field (count($members)) to show how many apartments fall under one building.. (this works)


Each apartment has a status field (dropdown) that is either 'Rented' or 'Available', I would like to count how many apartments are rented in each building.

In SQL it would look something like this:
FROM Building1
WHERE status = 'Rented'

How do I make this in sugar?