Knowledge Drop

How can I avoid a sql error when no value is selected for a parameter filter?

Userlevel 2

Last tested: May 29, 2020


Unlike templated filters, which will default to 1=1 when no filter value is selected, a parameter with no filter value selected will cause a sql error. If you need to use parameters instead of templated filters, and you want to avoid this error when no filter value is selected, we can add this to our sql:

{% if view_name.parameter_name._is_filtered %} [parameter filter statement] {% else %} 1=1 {% endif %}



This content is subject to limited support.                



0 replies

Be the first to reply!