I'm not sure that it's really simple, but it can be done. A simpler method is to use ExecuteSQL() if you have Filemaker 12.
The portal filter method:
Say that you have this relationship:
LayoutTableOccurrence::PrimaryKey = PortalTableOccurrence::ForeignKey
(any number of different relationships are possible here, I just need one to work from for what happens next.)
Let's also assume that there is a PrimaryKey field in the portal's table that uniquely identifies each record.
Create a new occurrence of the portalTable, call it UniquePortalTableOccurrence and link it to the original portalTableOccurrence:
PortalTableOccurrence::ForeignKey = UniquePortalTableOccurrence::ForeignKey AND
PortalTableOccurrence::NameField = UniquePortalTableOccurrence::NameField
Then you can use this portal filter expression:
PortalTableOccurrence::PrimaryKey = UniquePortalTableOccurrence::PrimaryKey
and your filter will filter out all but the first instance of each name in the set of related records.
"A simpler method is to use ExecuteSQL() if you have Filemaker 12."
How would you do this with ExecuteSQL()?
I know SQL well but am at a loss at how to use it in FM