Question

Is numeric comparison of parameter value in liquid syntax possible?

  • 26 March 2021
  • 0 replies
  • 4 views

I have a parameter where the user would enter a number of days. I would like to be able to set some logic based on greater or less than tests of this value. The problem I’m running into is that even if the parameter is set to number, it doesn’t seem that liquid syntax allows for any greater than or less than comparisons of the parameter value. 

Example:

The parameter that takes days.

  parameter: size_of_range {
description: "How many days in your period?"
label: "1a. Days in period"
type: number
}

What I would like to do with it, but doesn’t work.

{% if comparison_periods._parameter_value >= 3 %}
<some sql code>
{% endif %}

 


0 replies

Be the first to reply!

Reply