Session Relevance Help?

I believe I need to do a query with Session Relevance but I honestly have no idea where to even start. :open_mouth:

How would one return a list of all existing combinations of two properties? For example, if one property was “Color” (red, blue, black) and the other was “Model” (Camaro, Mustang, Challenger), how would I return the list of “red Mustang”, “white Camaro”, etc., based on what’s in the data. That is, if there are no blue Challengers, it shouldn’t be in the results even though it’s a possibility. I need only existing combinations.

Also, where would I even start to look to figure something like this out myself? There are lots of Client Relevance examples (see every Fixlet/Task, etc.), but not as much for Session Relevance.

Thanks!

Is this what your trying to end up with?

Property data

Combined via session relevance

Very nearly…what I need is both simpler and more complex. Don’t need item 0 (computer name) at all and will do a unique values of on the concatenation.

Now reading through what you did here to see if I can understand it at all and get to the point described above on my own. :rofl:

Looking at the end, do you need to know what some of the values are (re: “red” and “aston”)? Ideally I’d be just going off of the data, whatever it may be. :thinking:

No, those flters wouldn’t be needed. TBH I’d started building the query based on looking for any red car or any aston but then re-read your requirements and changed my approach. I used the Excel Connector to build most of the relevance, then manually modified it to concatenation the make and colour into a single result.

Maybe this is closer

(concatenation " " of (item 0 of it as string; item 1 of it as string)) 
of (
	(if (exists result (item 0 of it, item 1 of it) and 
		 exists values of result (item 0 of it, item 1 of it) ) 
		then (concatenation "%0A" of values of result (item 0 of it, item 1 of it)) 
		else ("<none>")), 
	(if (exists result (item 0 of it, item 2 of it) and 
		 exists values of result (item 0 of it, item 2 of it) ) 
		then (concatenation "%0A" of values of result (item 0 of it, item 2 of it)) 
		else ("<none>")))  
of (
	elements of intersection of (
		(sets of items 0 
			of (computers of it, values of it) 
				of results of bes property "Car Colour"); 
		(sets of items 0 
			of (computers of it, values of it) 
				of results of bes property "Car Make")),
	bes property "Car Colour",
	bes property "Car Make")
1 Like

Okay… so, how do you get from the Excel Connector to this?? :open_mouth: I’m looking at the EC now…really haven’t used it much (at all, really) in decades.

I then run the query and open the “Show Relevance Code” then edit the highlighted section with the relevance to concatenate the items and remove the white space from the filtering so it exclude devices with no reported data.

3 Likes

Got that far just after sending that. :laughing:

For this need, anyway, this was a lot easier than I thought. :joy:

unique values of
( item 0 of it as string & " - " &
item 1 of it as string )
of (
(if (exists result (item 0 of it, item 1 of it) and
exists values of result (item 0 of it, item 1 of it) )
then (concatenation "%0A" of values of result (item 0 of it, item 1 of it))
else ("")),
(if (exists result (item 0 of it, item 2 of it) and
exists values of result (item 0 of it, item 2 of it) )
then (concatenation "%0A" of values of result (item 0 of it, item 2 of it))
else ("")))
of (
elements of intersection of (
(sets of items 0
of (computers of it, values whose (it as lowercase = "car") of it)
of results of bes property "Vehicle Type");
(sets of items 0
of (computers of it, values whose (it as lowercase != "") of it)
of results of bes property "Color")),
bes property "Model",
bes property "Color")

Thanks for the help!!

3 Likes

The excel connector is great for this type of work.