Home / Blog / FileMaker / SortValues and UniqueValues: New FileMaker 16 Functions
09May 2017

SortValues and UniqueValues: New FileMaker 16 Functions

About the Author

Mislav Kos Mislav Kos

Mislav is a FileMaker developer and a Senior Technical Project Lead at Soliant Consulting.

Comments (4)

Vincent - May 9, 2017

I’m using BaseElement’s plugin sortvalues and unique for years. Could you add them in your very interesting performance comparison

    Mislav Kos
    Mislav Kos - May 9, 2017

    Hi Vincent, thanks for the suggestion. I may do this later on, but it won’t happen in the near future as I am quite busy at the moment.

Jeremy - May 23, 2017

I haven’t seen that QuickSort custom function in years! I’ve used this more recently ( It’s roughly based on timsort, which has theoretically better best-case and worst-case performance than quicksort, though I haven’t empirically confirmed how these two implementations compare.

I’m skeptical of the custom functions with larger lists. Linearithmic (O ( N Log N )) performance easily exceeds FileMaker’s custom function recursion limits. Note that the results from the quick sort function for even medium-size lists is “?”. The SortList function is able to extend this limit due to Agnès’ characteristically clever use of Evaluate.

Even then, the sort algorithm isn’t the only constraint on performance. Naïve parsing of any return-delimited list in FileMaker is quadratic (O ( n ^2 )), and more sophisticated parsing only improves that to O ( n^1.5 ). Parsing the list with functions exposed in FileMaker’s calculation engine is as much a limiting factor as the choice of sort algorithm. A linearithmic sort algorithm (e.g., quicksort, timsort, mergesort) on a return-delimited list implemented as a FileMaker custom function can only achieve O ( n^1.5 ) performance at best. One would hope that the built-in function could achieve better performance from being able to used cursor-based parsing of the list rather than the functions in the calculation engine.


Leave a Reply