clickhouse-odbc icon indicating copy to clipboard operation
clickhouse-odbc copied to clipboard

Using sql with ternary op doesn't work in Tableau

Open dmserg opened this issue 5 years ago • 3 comments

Using sql with ternary op doesn't work in Tableau - Questionmark(?) is treated as unnamed binding parameter. Example: Select (1 = 2 ? 3 : 4) is translated into select (1 = 2 {odbc_positional_1:Nullable(Nothing)} 3 : 4)

Replacing it with 'if' is a valid workaround but we have quite a lot big SQL reports using ternary op already. What's your view on this? Can it be fixed by distinguishing ternary from binding parameter?

dmserg avatar Nov 01 '20 16:11 dmserg

You can try \ to escape ?'s.

traceon avatar Nov 04 '20 13:11 traceon

You can try \ to escape ?'s. This doesn't work, 'unrecognized token' error.

dmserg avatar Nov 09 '20 07:11 dmserg

+1 ,I found the same problem using Power BI . Replacing all sql with 'if' is time cost as we have hundreds of querys Is there any easier way to solve it?

huangxp12 avatar Jan 29 '21 02:01 huangxp12