How to allow whitespace for Liquid parameter (unquoted parameter filed)

Hi, I am trying to use "parameter_value" as an if else condition value, but “true and” is not working since it contains a whitespace.

  1. I have 3 value for parameter

parameter: exists {
    type: unquoted
    
    allowed_value: {
      label: "Top 25 advertisers 90 Days ago"
      value: ""
    }
    
    allowed_value: {
      label: "Top 25 advertisers 365 days ago"
      value: "true and"
    }
    
    allowed_value: {
      label: "All"
      value: "NOT"
    }
  }

  1. The if else condition is updated according to the selected value.

WHERE
            {% parameter exists %} EXISTS ( SELECT * FROM (
            SELECT
              advertiser,
              SUM(revenue) as rev
            FROM
              A 
            WHERE
              utc_date = DATE_SUB(CURRENT_DATE(), INTERVAL {% if exists._parameter_value == '' %} 90 {% elsif exists._parameter_value == 'true and' %} 365 {% else exists._parameter_value == 'NOT' %} -2 {% endif %} DAY)
            GROUP BY
             advertiser
            ORDER BY
              rev DESC
            LIMIT 25) 
            )

Is there a way to allow whitespace in unquoted parameter filed? I am trying to create 3 buttons ([Top 25 advertisers 90 days ago, Top 25 advertisers 365 days ago, All ]) in the dashboard so that the dashboard is updated when the user clicks the button. I was referring to this article to work on it and there’s only two options but I need three options as a filter value.

1 0 164
0 REPLIES 0
Top Labels in this Space
Top Solution Authors