Sure, we can do that. It’s definitely a bit cumbersome though to start from the plural tuple result, and would actually be easier to do on your initial query that retrieves this info. Can you post that?
To handle the generic case though, in order to compare all the elements of a plural tuple I believe we need to cast them into a string set, so we can preserve all the results as we compare them to each other. My final result is
q: tuple string items 1 of items 0 of (elements of item 0 of it, item 1 of it) whose (tuple string item 0 of item 0 of it as integer = item 1 of it) of (it, minimum of (tuple string items 0 of it as integer) of elements of it) of set of (it as string) of (1, "10.70.30.100"; 25, "192.168.0.24")
A: 10.70.30.100
T: 0.184 ms
I: plural string
Here’s the explanation of the steps to get there -
// Build a resulting plural tuple for testing
q: (1, "10.70.30.100"; 25, "192.168.0.24")
A: 1, 10.70.30.100
A: 25, 192.168.0.24
T: 1.649 ms
I: plural ( integer, string )
// We can't have a "set of <tuple>", but we can cast each result into a tuple string...
q: (it as string) of (1, "10.70.30.100"; 25, "192.168.0.24")
A: 1, 10.70.30.100
A: 25, 192.168.0.24
T: 1.538 ms
I: plural string
// and then put those strings into a set
q: set of (it as string) of (1, "10.70.30.100"; 25, "192.168.0.24")
E: This expression evaluates to an unrepresentable object of type "string set"
T: 1.430 ms
I: singular string set
// Just to check, the set has one element for each result
q: elements of set of (it as string) of (1, "10.70.30.100"; 25, "192.168.0.24")
A: 1, 10.70.30.100
A: 25, 192.168.0.24
T: 1.290 ms
I: plural string
// and each element can be seen as a tuple string
q: (tuple string items 0 of it, tuple string items 1 of it) of elements of set of (it as string) of (1, "10.70.30.100"; 25, "192.168.0.24")
A: 1, 10.70.30.100
A: 25, 192.168.0.24
T: 1.175 ms
I: plural ( string, string )
// We can find the lowest interface index by finding the lowest item 1 (casting it to Integer) in the set
q: (minimum of (tuple string items 0 of it as integer) of elements of it) of set of (it as string) of (1, "10.70.30.100"; 25, "192.168.0.24")
A: 1
T: 0.992 ms
I: singular integer
// We need to retain the original set, as well as the lowest value in the set, so we can loop it later
q: (it, minimum of (tuple string items 0 of it as integer) of elements of it) of set of (it as string) of (1, "10.70.30.100"; 25, "192.168.0.24")
E: This expression evaluates to an unrepresentable object of type "( string set, integer )"
T: 0.750 ms
I: singular ( string set, integer )
// Now loop through the whole set, and show each element along with the lowest interface index
q: (elements of item 0 of it, item 1 of it) of (it, minimum of (tuple string items 0 of it as integer) of elements of it) of set of (it as string) of (1, "10.70.30.100"; 25, "192.168.0.24")
A: ( 1, 10.70.30.100 ), 1
A: ( 25, 192.168.0.24 ), 1
T: 0.574 ms
I: plural ( string, integer )
// We need to keep only the element from the set that matches the lowest index
q: (elements of item 0 of it, item 1 of it) whose (tuple string item 0 of item 0 of it as integer = item 1 of it) of (it, minimum of (tuple string items 0 of it as integer) of elements of it) of set of (it as string) of (1, "10.70.30.100"; 25, "192.168.0.24")
A: ( 1, 10.70.30.100 ), 1
T: 0.387 ms
I: plural ( string, integer )
// and from that element in the set, that matches the lowest index, we only need to keep the IP address value
q: tuple string items 1 of items 0 of (elements of item 0 of it, item 1 of it) whose (tuple string item 0 of item 0 of it as integer = item 1 of it) of (it, minimum of (tuple string items 0 of it as integer) of elements of it) of set of (it as string) of (1, "10.70.30.100"; 25, "192.168.0.24")
A: 10.70.30.100
T: 0.184 ms
I: plural string