Singular expression refers to a non unique object help please

Im trying to get the link speed of each adapter thats up and connected.

q:friendly names of adapters whose (up of it) of networks
A: Ethernet
A: vEthernet (Default Switch)
T: 13.775 ms

q: (Link speed of adapters whose (up of it) of networks /1000000) of network as string & " Mb/s"
A: 1000 Mb/s
E: Singular expression refers to non-unique object.

Pete, try this:

((Link speed of it/1000000) as string & “MB/s” ) of adapters whose (up of it) of networks

and if you want to see the adapter’s name associated:

(friendly name of it, (Link speed of it/1000000) as string & “MB/s” ) of adapters whose (up of it) of networks

Nailed it @Kapax … thank you!.. One day this will all Click :wink:
Im getting there … lol

Looks like there are duplicate “of network” here that shouldnt be

Whenever you are using a singular term “link speed” you are saying that you only want one result. Plural means 0,1,2,3+ results.

There is only one network object so singular there is fine, you are using plural for adapter (adapters) but your link speed is singular.

(Link speeds of adapters whose (up of it) of networks /1000000) as string & " Mb/s"

This then breaks because you cant divide a plural value so…

You really want to perform MB/s and the division on each linkspeed value so you can do it in a separate block:

First: Link speeds of adapters whose (up of it) of networks

Second: (it) of link speeds of adapters whose (up of it) of networks

Third: (it / 1000000) of link speeds of adapters whose (up of it) of networks

Fourth: ((it / 1000000) as string & " Mb/s") of link speeds of adapters whose (up of it) of networks

2 Likes

Many thanks for the break down @strawgate .
That really helps

You see this is part of my issue with getting these aging grey matter cells around these
There are several ways of getting a result…
@Kapax Version.

q:((Link speed of it/1000000) as string & “MB/s” ) of adapters whose (up of it) of networks
A: 1000MB/s
A: 10000MB/s
T: 9.367 ms

@strawgate Version

q:((it / 1000000) as string & " Mb/s") of link speeds of adapters whose (up of it) of networks
A: 1000 Mb/s
A: 10000 Mb/s
T: 11.389 ms

The result is the same, but the times are different.

Many thanks to both of you !

Times under about 25 ms aren’t likely to have an impact or be accurate:

q:((Link speed of it/1000000) as string & "MB/s" ) of adapters whose (up of it) of networks
A: 156MB/s
T: 16.283 ms

q:((it / 1000000) as string & " Mb/s") of link speeds of adapters whose (up of it) of networks
A: 156 Mb/s
T: 13.965 ms

They are actually the same query just formatted differently.

In this case these two are identical:

  1. Link Speeds of adapters of network
  2. (Link Speed of it) of adapters of network

And so you can see that if the above two cases are identical that both queries above are actually identical – I just wanted to show you how I think about the problem and how I build up to a query like that in my head :slight_smile:

2 Likes

… I know I have been lazy: will do better next time! :slight_smile:

1 Like

The combination of getting the right answer answer fast and getting a long explanation a little bit later beat getting one or the other any day :slight_smile: