Skip to Main Content

Analytics Software

Announcement

Testing banner

Including a Presentation Variable in Custom SQL

In an analysis, I can add a filter that refers to a presentation variable, and that filter looks like this:
Customer Name is equal to / is in @{MyCust}
If I want the filter to default to all values, I can refer to the presentation variable like this:
@{MyCust}{%}
Today, I'm creating an analysis using custom SQL. I want to include a where clause that uses @{MyCust}{%}, or its equivalent. When I include such a where clause, this error is thrown:
nQSError: 10058 A general error has occurred.
nQSError: 27002 Near <%>
SQL Issued: call NQSGetLevelDrillability('SELECT "Customer"."Name" saw_0 from "AR Invoices" where "Customer","Name" in (%) ')
Although the % is handled correctly in an "ordinary" analysis, it does not work in custom SQL.
Is there a syntax that I can use to accomplish this same type of filter in custom SQL?

This post has been answered by Federico Venturin on Jan 19 2023
Jump to Answer
Comments