Hi @Chr1sG. Thanks for that clarification, and sorry for not having explained it better. Based on your answer, I realised that I had framed my request completely incorrectly. Below is the process to correct the framing, using an example with fictitious, descriptive field names.
Clarifying my request
My Incorrect framing
I had completely mis-framed my original request, by asking for Entities.Distinct() to return distinct Entities, as you are correct that Entities is already distinct without duplication.
Corrected framing
I should have framed Distinct() or Unique() as a flattening aggregation function to return something that right now is not possible, i.e. a field from *-to-many relations e.g. Entities.Distinct([State]).
With this, the 3-step approach above would turn into:
Tasks.filter(Lower(State.Type) != "finished").Distinct(Assignee).Join(Name, ",")
The issue
The issue lies in multi-hop relation formulas, where the following would return the same Assignee.Name multiple times, if the Project has different Tasks with the same Assignee
Tasks.filter(Lower(State.Type) != "finished").join(Assignee.Name, ",")
Current 3-Field Workaround
Right now, we can only solve this using three fields as follows.
1. Filtering Formula on Tasks
An Assignee (State of Unfinished) formula field on Tasks with a formula to move the filtering here:
if(Lower(State.Type) != "finished",
Assignee,
Assignee.[AnyCollection].Filter(true = false).Sort().First().Assignee
)
Note: the final argument is used to return an empty/null of the same Type as Assignee. AnyCollection can be any to-many relation field (e.g. Tasks, Holidays, etc.) on the Type/Database of Assignees (e.g. Users).
2. Rollup #1’s values up on Projects via a Lookup
To deduplicate the Assignees, an Assignees (from Tasks with State of Unfinished) lookup field on Projects
3. And finally the modified original formula for the Join
To access the deduplicated Assignees, in case we wanted to Join their Names for a label, aggregate some field from them, etc.
[Assignees (from Tasks with State of Unfinished)].join(Name, ",")