Calculate unique items outside a repeat

Yes

1. What is the issue? Please be detailed.
How to calculate to return unique items from a repeat nodeset and then use count-selected() to count number of unique item?

Example, id are repeatedly recorded 5 times as 1,2,1,3,5

There is no such function like unique(${id}), is there an alternative way to returns a space-delimited value eg. 1 2 3 5 and then use count-selected(1 2 3 5) to returns value 4.

2. What steps can we take to reproduce this issue?

3. What have you tried to fix the issue?

4. Upload any forms or screenshots you can share publicly below.

This feels closely related to Add distinct function for use with entities and the goal would be to serve both needs in the same way. Maybe you could briefly describe your use case in that thread?