Seems like you are running into a reserved word issue. See this documentation for instructions on how to use reserved words in OQL queries: https://docs.mendix.com/refguide/oql/#reserved-oql-words
Post your OQL, or at least the relevant part.
You should be able to do the following:
alias/stringattribute != null (means: not empty)
alias/stringattribute != '' (means: not empty string)
LENGTH(alias/stringattribute) != 0