Hi everyone, in our environment we are facing a limitation related to query models which contains filter conditions related to strings with forbidden characters.
In our specific case, we need to filter on string like “abc\def”. If we build the query doubling the "" the query works and the results are displayed but when we save the model all "" are removed.
Do you know any workaround?
We also tried to rewrite the query using functions (like substrings) to overcome the forbidden characters but the performance are terrible respect to the original preview.
Hi @radema,
Thanks for sharing the details of your issue.
You’re right—string filters with backslashes (like "abc\def"
) can sometimes be tricky, and Holistics haven’t handled this well, especially when saving or editing queries in the UI, as certain characters may get stripped out.
Workaround:
If you write your query directly in code using the raw SQL block (like in your example below), you can use escaped backslashes, and it should work as expected:
Model example_model {
query: @~sql SELECT *
FROM example_table
WHERE example_dimension = 'abc\\def';;
}
The secret is using the @~sql
, instead @sql
Please Note:
This method only works when editing the model’s code directly . Unfortunately, if you try to build or edit the filter through the UI, the backslashes may be removed or not handled correctly.
This is just a workaround, we will improve this behavior to make it consistent whether you create/modify the query via code or UI
Hi Kai, thanks fornyour replay. At the end we found out a workaround using the hex translation for the specified strong. However, good tò know that there exists another method