Hi,
In AL we have a CalcSum function which calculation of the sum on a certain field within a un/filtered record set.
Currently, if someone needs to find the maximum or minimum value of a field within a record set, the person will need to loop through ALL the filtered records and check each value.
A CalcMax and CalcMin functions are therefore quite valuable to have, since they have a positive impact on performance.
SQL already has a Max and Min function.
Comments
Thomas, keep in mind sorting on the fields depends on the key chosen by the system (not necessarly) the one selected by the programmer. This can affect your sorting order and yield wrong min/max
Category: Development
When I need min and max of a value, I sort by that field and do FindFirst and FindLast.Depending on how often you need that in a specific table, I create a key with the filter fields and the field to be sorted by.
Category: Development
Business Central Team (administrator)
Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future. Best regards, Business Central Team