Passing strings containing ' (apostrophe) from Quicksight filter to Snowflake direct query

I have a multiple value parameter where any number of strings can be selected, for example strings can be like, ‘ABC_Q1’24’, ‘DEF_Q1’24’

When I select a string from the filter, it is passed to a direct query in Snowflake which should populate data in a table in Quicksight.

The table doesn’t populate any thing and when I go to Snowflake, I see that the JDBC client is passing ‘ABC_Q1’, ‘DEF_Q1’.

I noticed that the query works if the parameter is single-valued but doesn’t work for multiple valued parameters.

Would appreciate any help or ideas to work around this!

1 Like

Hello @arimando, welcome to the QuickSight community!

Is your dataset directly linked to a view or table in Snowflake or are you building it with custom SQL in QuickSight? I think the most likely solution to this issue will be to reformat the field value to exclude the apostrophe. Maybe using something like replace in your SQL statement to remove the apostrophe would help fix this issue.

https://docs.snowflake.com/en/sql-reference/functions/replace

It seems like it is confusing it for the end of the string value which is causing the query to fail to load any data.

Let me know if this helps resolve your issue!

1 Like

Hi @DylanM thank you for the warm welcome!

The dataset is a direct query to a table in Snowflake. As a workaround, I removed the apostrophe, but this isn’t ideal. I have end users that download the tables into a CSV and require the strings to be exactly what they were upstream for further downstream tasks.

I am hoping to be able to support the apostrophe in strings. I also tried many escaping methods in Snowflake before it is passed to Quicksight and still doesn’t work.

1 Like

Hello @arimando, since the apostrophe is causing an issue and removing it is only a work-around rather than a solution to the issue, I will mark this topic as a feature request. Please let me know if you have any further questions on this topic, otherwise I can archive it for our support team. Thank you!

1 Like

Hello @arimando, since we have not heard back from you with any follow-up questions, I will archive this topic for our support team. If you want any further assistance on a work-around solution, please post a new question in the community and link to this topic. That will ensure you are at the top of the priority list for a response from one of our QuickSight experts. Thank you!