If Patient::Unit is global, the value is same in all records, portal become all or nothing.
Then, change relation oerator to X from =. and apply portal filter as Front::Unit=Patient::Unit may be same result what you want.
The calculation is not working because it's unstored, therefore unindexable and cannot be used for the "child" part of a relationship.
What I don't understand is why are you calculating from the global field? A global has the same value across all records.
What's the scenario that would cause PATIENT::unit to be global? Seems odd that an attribute of patient would be the same across all patients.
Anyway, I'd create another calculation field that only references fields in the same table, in your case PATIENT, so that the result is indexed and can be used as a "child" TO in a relationship.
The global field is required because it is a dropdown to select a specific value.
user19752: I've tried the X operater, but as soon as I add the filter, all records disappear from the portal.
Hudi: How does "create another calculation field that only references fields in the same table" differ from what I'd done? ie. a calc field that takes the global field's value.
I have found a solution. The field from which the global field is originally set, is indexed and therefore works in the relationship. I've had to use a textbox to re-label the field's checkbox value; not neat but works.
I'm a little confused but as long as you got it working, great!
The reason for not referencing the global field in your calculation is
because that causes the calculation to be unstored. FM will not index a
calculation result that uses a global value.