Looking for help with proximity logic in TextIQ | XM Community
Skip to main content
Question

Looking for help with proximity logic in TextIQ

  • April 10, 2025
  • 1 reply
  • 16 views

Forum|alt.badge.img

Hi all — I’m working in TextIQ (Qualtrics) and trying to search for responses where two sets of keywords appear within 4 words of each other. For example:

((doctor | dr | provider) AND (nice | tone | explain))~4

 

Unfortunately, Qualtrics gives me an “invalid operator” error when I try something like that.

My current workaround is to create a parent topic like Bedside Manner with terms like nice | tone | explain, and then a sub-topic with provider keywords like doctor | provider | dr. But the problem is this doesn’t restrict the match to within 4 words — so I’m getting results where “Doctor” is in the first sentence and “answering” is in the last.

Has anyone figured out how to enforce proximity between keyword sets in TextIQ? Or any creative workarounds to simulate this?

Would really appreciate any ideas — thanks in advance!

1 reply

Forum|alt.badge.img+3
  • 18 replies
  • April 11, 2025

Problem

Qualtrics TextIQ allows you to search for terms within a specific word distance using the ~# operator, where # is the maximum number of words apart (e.g., ~4 for within 4 words). However, your original attempt—((doctor | dr | provider) AND (nice | tone | explain))~4—is invalid because the proximity operator must be applied to phrases, not directly to sets of alternatives. 

Solve: 

To find responses where any word from the first set (e.g., doctor, dr, provider) is within 4 words of any word from the second set (e.g., nice, tone, explain), you can construct a query by combining all possible pairs with the ~4 operator and joining them with OR. For example:

  • The query would look like:

("doctor nice"~4 OR "doctor tone"~4 OR "doctor explain"~4 OR
 "dr nice"~4 OR "dr tone"~4 OR "dr explain"~4 OR
 "provider nice"~4 OR "provider tone"~4 OR "provider explain"~4) 

Recommendation : 

While this approach works, it can become unwieldy for larger keyword sets. For instance, if the first set has 5 keywords and the second set has 5, you’d need 25 combinations, making the query lengthy and potentially harder to manage. TextIQ’s documentation does not specify a limit on query complexity, but for practical purposes, it’s advisable to test the query in small increments to ensure it processes correctly.

If the query becomes too complex, another approach is to:

  1. Create separate topics for each keyword set using the search functionality.
  2. Filter responses that contain both topics, but note that this won’t enforce proximity directly.
  3. Manually review the results to identify responses where the terms are close, though this is less efficient and defeats the purpose of automation.

you can read more here Topics in Text iQ


Leave a Reply