How to escape backslashes

A field in my dataset contains folder paths and hence backslashes. My visual uses a control parameter where the user enters a folder path. I have added a filter that updates the information displayed in the visual based on what is entered in the control parameter. Filter: where fullpath = control parameter value.

I get an error when I try an unescaped folder path as well as escaping with a backslash (“your database generated a SQL exception”). What is the correct way of escaping the backslash?

Backslash is the escape character in Quicksight. Use a backslash to escape a backslash.

1 Like

This appears to be an issue with direct connections, it works just fine in SPICE.

This looks like a bug with how QuickSight handles backslashes for the datasource you are using in your direct query. But as a workaround, maybe you could replace your filter the following:

Add a calculated field path_filter

ifelse(replace(${campaignSelection},'\\','\\\\') = {fullpath}, 1, 0)

Then replace your existing filter on the table with one that checks if path_filter=1