Hey guys!
Once again I come to ask you for help with a situation in my project.
I need to count distinct records in my aggregate.
The result I'm trying to get is how many distinct users I have in my CreatedBy column so I can use the result of that count in an expression on my screen.
Thank you very much to anyone who can help!
Thank you very much
You can execute a SQL statement like
SELECT COUNT(DISTINCT columnName) FROM tableName WHERE condition;
This will perform better and there is reduced data transfer in this particular scenario.
Hi Luiz,
Using a 'Group By' on your CreatedBy column in the aggregate (and then taking the length of the resulting list) should give you just that.
(Right click on the column and then select 'Group By')
Hi @Luiz Lima
just group by the column that has unique values and then aggregate count it self give you that value.
Thank you very much to everyone who helped, all the solutions were valid!
Thank you very much.
Although all replies marked as solution give you the desired result, only the reply with the SELECT DISTINCT is the best reply, as it wil perform way better then the group by solution with using an aggregate.
Always keep in mind performance.