encoded query conditions - How to group operations

Stephen W_
Giga Guru

If I wanted to set a reference qualifier to something like:

 

(name ==='a' and class ==='b') or (name ==='c' and (class ==='d' or class ==='e'))

or

name === 'a' and (class === u_something.class or class === u_somethingelse.class)

 

 

Is that possible as an encoded query, or would I need to call an include script to put those results into a list?

 

Thanks,

-Stephen

 

--------------------------------

 

Note that the accepted answer is not the correct answer in this case.       I've added the correct answer as a reply at the bottom.

1 ACCEPTED SOLUTION

There is no equivalent. What is your business requirement? Perhaps we can brainstorm a solution outside of the qualifier.


View solution in original post

8 REPLIES 8

kyleb13281
Kilo Expert

Steve,


If the encoded query did work, the syntax would look a bit like this:



'name=a^name=b^ORname=c^sys_class_name=d^ORsys_class_name=e'



Give it a go and see if it works.



Kyle


Stephen W_
Giga Guru

Can you then explain how the grouping works? (assuming you meant   'name=a^sys_class_name=d=b^ORname=c^sys_class_name=d^ORsys_class_name=e')



To me, your statement looks like:


name==='a' && class ==='b' || name==='c' && class==='d' || class ==='e'


Which would not be the same as:


(name==='a' && class ==='b') || (name==='c' && (class==='d' || class ==='e'))


or


(name==='a' && class ==='b') || (name==='c' && class==='d') || (class ==='e')






(FYI, this is hypothetical at this point since I ended up doing something like 'name=a^sys_class_nameINmyclass,myotherclass'.)


I just need to know how the grouping would work since a parenthesis isn't accepted.




Thanks!


-Stephen


adiddigi
Tera Guru

So, if the encoded strings follow the same rules.   It's not possible to group OR operations.. right?


'name=a^sys_class_name=b^ORname=c^sys_class_name=d^ORsys_class_name=e'



Will be evaluated as:


(name=a^sys_class_name=b)^OR(name=c^sys_class_name=d)^OR(sys_class_name=e)



Which means queries such as my original question are impossible:


name==a && (sys_class_name==b || sys_class_name==c || sys_attrib_name==d)




Without writing them out redundantly:


name=a^sys_class_name=b^ORname=a^sys_class_name=c^ORname=a^sys_attrib_name=d




Am I mistaken?   Is there an equivalent to parenthesis to modify order of operations?