Flowfield for a MAX value- Sorting

Hi everyone,

I created a custom flowfield with the following calcformula:
Max(TabXxx.“Posting Date” WHERE (Customer No.=FIELD(Customer No. Filter)))
whrere “Customer No. Filter” is a flowfilter.
When “Customer No. Filter” consists of a single customer no., the flowfield returns a correct value for the max date.
But when there are several customers in the filter, the flowfield returns a wrong value.
It looks like it is sorting by customer and getting the max date for the last customer in the filter…
Does it really work this way?

Thanks in advance :)

better you develope that issue by code.