09-22-2021 12:42 PM
@altenbach wrote:
It is not clear how you do conflict resolution, but I guess the "Groups by Socket" is meaningless if there are still duplicates. For example it is not clear why you decide that the first element is 7 and not 2.
Here's my quick attempt. Same result (except first element is 2 instead of 7. Maybe less code, or at least easier to read). No guarantees. 🙂
One flaw there is that it assumes that valid data never references group 15. That is not a valid assumption. Valid data can reference any group.
09-22-2021 04:11 PM
I probably would use -1 for missing values. Currently, it is a control. It could be made into an indicator and use the max+1 (or higher) of the first loop. Or we could check it against the max and create yet another error. (fortunately, my error code is quite scalable and could be extended with just a little bit more code. 😄
09-23-2021 07:24 AM - edited 09-23-2021 07:28 AM
@altenbach wrote:
... and a quick attempt to consolidate all that duplicate code for the error prep (just for fun 😉 ).
Thanks for that. Here's my variant:
While looking at error messages, I realized that "Sockets in more than 1 group: 0" could be misinterpreted as meaning that the number of sockets in more than one group is zero. I think adding "#" clarifies it: "Sockets in more than 1 group: #0".
I also took advantage of the not-too-well-known "%0.0s" format specifier (it means 'discard the string').
09-23-2021 12:43 PM
Yes, yours is slightly more scalable, because it can deal with more than two input arrays of different lengths.
(Of course converting an empty 1D array to a spreadsheet string followed by trimming and formatting is unnecessary work, but no big deal in this case 😉 )