If you can retrieve the data directly from the database, it will only retrieve unique objects. There are some performance benefits when you retrieve a list of objects and use it for an aggregate action only, the aggregate action should be placed directly behind the retrieve action.
In the case you cannot retrieve the list directly from the database, you can use the union list operation to remove any duplicates. Use the list variable for both parameters.
Thank you for your reply. I used it but getting zero value. Is there any mistake that I have done.
Please find below below image for your reference.
Hi, chandra shekar,
You can use OQL Statement. It is quicker.
Documentation :
https://docs.mendix.com/refguide/oql
Demo app where you can play with the Queries.
https://mydemoversion8-sandbox.mxapps.io/p/OQL
You have a module for OQL: https://marketplace.mendix.com/link/component/66876
While the OQL module is the most optimized because it avoids the loading of objects, this module is easier to use but expects the list as input.
Count Values Of Member :
https://marketplace.mendix.com/link/component/121239