Count the data

I have a list view, and I sort out the list view using filter widgets. Once filtered, I need show the count of the filtered values. Is It possible? And the flow please?
2 answers



I would use the create the source of the data over an OQL statement, where the input for the filters will be driving the WHERE statement in the OQL query. Each change in the filter will result in a unique list (the filter result) that can be used for the “Aggregate list” Action to count the results. Furthermore using OQL is much faster than filtering in a list and can be used in large data sets.



An example of the OQL statement:

 E.Timestamp Timestamp,
 E.Application Application,
 E.System System,
 E.Model Model,
 E.Location Location,
 E.Country Country
 MyFirstModule.Events E
 E.Timestamp = $Timestamp AND
 E.Application = $Application AND
 E.System = $System AND
 E.Model = $Model AND
 E.Location = $Location AND
 E.Country = $CountryInput


In the flow, I use a Create Variable Action as the source of the Country, but in your case, it is the Non-Persisting Entity that contains the input variables for the Filter.


If you need additional guidance, mail me for a short screen-sharing session.


Go Make It




I don't think this is something which is possible out of the box. Usually we fix this using a seperate KPI entity using logic to filter and count certain items within the list to show in badges or other places on the page. 

Retrieving and counting in Mendix is really quick, so this should not be a problem to do for different scenarios on a page load, for example.