Can you clarify a bit what you mean with point a about the non-exact matches? Can you (given this sample data) sketch what the expected output of the query would be? E.g. having Pq3, pq3 and pq_3, do you want the query to just tell you that pq3 exists in the lookup but Pq3 and pq_3 don't? Or should the query try to also match those 'imperfect' cases and if so should the query highlight that it is a non-exact match? What you could do to cover all that is this: First: create a lookup definition "pq" that refers to the pq.csv lookup file and configure that lookup definition to be case sensitive (as it is by default I believe) Then, run this query (not tested, so you may need to debug the SPL a bit in case I made some typo or so): ...your current query...
| eval cleanedPQ = replace(lower(PQ),"[^a-z0-9]","")
| eval from="query"
| append [ | inputlookup pq.csv | eval from="csv" | eval cleanedPQ = PQ]
| eventstats dc(from) as exact_match by PQ
| eventstats dc(from) as nonexact_match by cleanedPQ
| eval match = case(exact_match>1,"exact",non_exact_match>1,"non-exact",true(),"no match")
| stats values(from) as from values(match) as match values(ACT) as ACT values(cleanedPQ) as cleanedPQ by PQ
... View more