Session Relevance Query Troubleshooting

Hi

I have a session relevance query which works on my system, but comes up with an error when running on a customer’s system (of which I do not have direct access).

The error being returned is: ‘Singular expression refers to non-unique object.’

I believe I understand what the error is stating, that I’m expecting a singular value to be returned, but multiple items are actually being returned in an array. The problem is I do not know which property has the issue, and it works without error on my simple test system. I would be very grateful if someone could help me troubleshoot this.

The query I’m running is:

("<Item>" &
  "<ComputerName>" & item 0 of it & "</ComputerName>" &
  "<LastSeen>" & item 1 of it  & "</LastSeen>" &
  "<IpAddress>" & item 2 of it & "</IpAddress>" &
  "<LicenseType>" & item 3 of it & "</LicenseType>" &
  "<DeviceType>" & item 4 of it & "</DeviceType>" &
  "<Domain>" & item 5 of it & "</Domain>" &
  "<Make>" & item 6 of it & "</Make>" &
  "<Model>" & item 7 of it & "</Model>" &
  "<ComputerType>" & item 8 of it & "</ComputerType>" &
  "<IsLaptop>" & item 9 of it & "</IsLaptop>" &
  "<DnsName>" & item 10 of it & "</DnsName>" &
  "<OsSmall>" & item 11 of it & "</OsSmall>" &
  "<OsFull>" & item 12 of it & "</OsFull>" &
  "<OsVer>" & item 13 of it & "</OsVer>" &
  "<Ram>" & item 14 of it & "</Ram>" &
  "<CpuSpeed>" & item 15 of it & "</CpuSpeed>" &
  "<CpuName>" & item 16 of it & "</CpuName>" &
  "<CpuLogicalCount>" & item 17 of it & "</CpuLogicalCount>" &
  "<CpuCoreCount>" & item 18 of it & "</CpuCoreCount>" &
  "<CpuCoreCount2>" & item 19 of it & "</CpuCoreCount2>" &
  "<CpuPysicalCount>" & item 20 of it & "</CpuPysicalCount>" &
  "<User>" & item 21 of it & "</User>" &
  "<BiosDate>" & item 22 of it & "</BiosDate>" &
  "<UserLang>" & item 23 of it & "</UserLang>" &
"</Item>")
of (
  name of it,
  (last report time of it as string | ""),
  ((concatenation " : " of values of it as string | "") of results from (bes property whose (name of it = "IP Address")) of it),
  (License Type of it | ""),
  (Device Type of it | ""),
  ((if it starts with "<" then "" else it) of value of results from (bes properties "Domain/Workgroup - Windows") of it | ""),
  ((if it starts with "<" then "" else it) of value of results from (bes properties "Computer Manufacturer - Windows") of it | ""),
  ((if it starts with "<" then "" else it) of value of results from (bes properties "Computer Model - Windows") of it | ""),
  ((if it starts with "<" then "" else it) of value of results from (bes properties "Computer Type") of it | ""),
  ((if it starts with "<" then "" else it) of value of results from (bes properties "Laptop - Windows") of it | ""),
  ((if it starts with "<" then "" else it) of value of results from (bes properties "DNS Name") of it | ""),
  (Operating System of it | ""),
  ((if it starts with "<" then "" else it) of value of results from (bes properties "Full Operating System Name and Service Pack Level - Windows") of it | ""),
  ((if it starts with "<" then "" else it) of value of results from (bes properties "OS Version Number - Windows") of it | ""),
  ((if it starts with "<" then "" else it) of value of results from (bes properties "RAM") of it | ""),
  ((if it starts with "<" then "" else it) of value of results from (bes properties "CPU") of it | ""),
  ((if it starts with "<" then "" else it) of value of results from (bes properties "Brand String of CPU - Windows") of it | ""),
  ((if it starts with "<" then "" else it) of value of results from (bes properties "Number of Processors - Windows") of it | ""),
  ((if it starts with "<" then "" else it) of value of results from (bes properties "Number of Processor Cores - Windows") of it | ""),
  ((if it starts with "<" then "" else it) of value of results from (bes properties "Core Processor Count") of it | ""),
  ((if it starts with "<" then "" else it) of value of results from (bes properties "Physical Processor Count") of it | ""),
  ((if it starts with "<" then "" else it) of value of results from (bes properties "User Name") of it | ""),
  ((if it starts with "<" then "" else it) of value of results from (bes properties "BIOS") of it | ""),
  ((if it starts with "<" then "" else it) of value of results from (bes properties "User Language - Windows") of it | "")
)
of bes computers

Again, any help would be most appreciated.

Thanks

Gary

Gary,

When I run this in my environment I also get ‘Singular expression refers to non-unique object.’ I found that property “Brand String of CPU - Windows” was returning a plural string. I was able to get around the problem by concatenating the strings together

 ((if it starts with "<" then "" else it) of concatenation "~" of value of results from (bes property "Brand String of CPU - Windows") of it | "")
3 Likes

@zpt8mjs Thanks Matthew, I’ll give that a try. :smiley:

I would recommend doing it this way:

concatenation "whatever_separator_you_wish" of unique values of ...

unique values will collapse any duplicate values into one, which is the most common case. Then using concatenation in case there are still multiple with a separator to truly go from plural to singular.

1 Like