Query Results Bug / Custom Attributes

I’m baffled! Running a simple PageView query against one of our custom attributes (search_query) and not getting accurate results… clearly!

Using the query “SELECT * from PageView where search_query like ‘%lname=|%’”

This should return results that have nothing in the “lname” parameter. However the results being shown to me in the query builder has results like “lname=ralston|”, but should only be returning results with an empty lname parameter (ex. “lname=|”).

Why is this query not matching correctly?

Helpful Resources:

SELECT * from PageView where search_query = 'lname=|'

Does that work?

2 Likes

Hey @pchimbolo - Adding to @6MM’s point, your query:

SELECT * from PageView where search_query like ‘%lname=|%’

is running with wildcard characters, the % wildcard character before and after your search filter states to the query to search for anything that has the string lname=| in it, regardless of what comes before or after that string. This is why you are getting results that contain lname=ralston

You may be better suited to search for something like:

SELECT * from PageView where search_query like ‘%lname=|’

As @6MM Suggested

1 Like

OK, this bug is me! Turns out there was another parameter called “fullname” which obviously contains the text “lname”.

That’s what I get for staring at the code all day and getting cross-eyed while losing sight of the obvious matching that was going on with that other parameter. Ugh!!!

Thanks for the input guys.

1 Like

Glad to hear you got it figured out :smiley: Thanks for posting back here