Hello! I have a novel use of liquid values I need some help understanding.
I am building an explore which runs off of a parameterized PDT allowing a stakeholder to input a comma-delimited list of numerical values (e.g. 1,2,3) which should feed into a liquid value I placed inside an IN statement filter.
Here’s an example of what the (sterilized) LookML code looks like:
First, I defined the input parameter in the view file:
parameter: categories_list
type: string
default_value: “1,2,3”
description: “Enter a comma-separated list of numerical categories.”
Then, I pull this parameter into my PDT in the same view file using liquid values. See below:
SELECT ***
FROM ***
WHERE ***
AND my_table.my_category IN( {% parameter categories_list %} )
One very important note-- in my example above I am looking for matching values to the field my_category in the IN statement, but the values in my_category are numerical data types! The only way I could find to enable a list of ids to be entered was by using a string-type parameter, so when the liquid value gets inserted it looks like this: IN(‘1,2,3’) which is obviously not syntactically correct.
See the following error message:

So the main issue I’m having is how I can remove those single quotes Looker throws on my input value so that it is, in fact, a list of numerical values and not a string. When I change the parameter type to number it only allows me to input a single number when I need it to accept a list of numbers. Any sort of manual removal of the single quotations (for example, REPLACE(‘1,2,3’, ‘’‘’, ‘’) doesn’t even seem to affect the parameter.
Any help appreciated!