In this example there is just one Company which can be closed (OrderCompany). It maybe would make more sense to just close one of the two OrderCompanyDepartments. You can both select them in the green textbox. There, a selection means it is closed.
So you may "close" - or select Department 0200 which contains 2 orders.
Now the tables on the bottom should show, where the order are moved to according to the lowest distance Of course, "closed" companies must not be selected as "new". I may provide a bit more data --> new example here!
Table with red box on the left:
-lowest distance works (is it right?)
-the company does not work (for Order 96288 it has to 521186215 (the lowest distance - company is closed) and for order 96761 company 521101145).
Table on the left:
Has to show these companies with both "1" as new Order in this example.
thank you very much! This is exactly what I was searching for. The problem with same minimum distances is a special one which we did not make a decision on it, yet. For instance, could you "just" tell me, how the count (distinct order) formula would look like if we take the statistical approach (one order which has two companies with same distance goes with 0.5 to each of them?)?