With 4D v15 R4, a new parameter is introduced for the DISTINCT VALUE command. This parameter must be an array, and it receives the count of each distinct value in a selection of records.
This feature is particularly useful for obtaining statistics on records, or to order records by their most common type.
For example, I have a selection of invoices grouped by distinct cities. I want to present the cities ordered from the one which has the most invoices, to the one which has the least. With the new parameter, this use case just takes you one line of code!
Example
You will find a demo using this command with a nice use case in the following example:
For more details, please refer to the 4D v15 R4 upgrade manual in Doc Center.