Skip to main content

Dear Experts, I want to use case when or if statement in component filter. The reason is that I want to set the default value when the button dropdown is not selected when the condition is set for process explorer using a variable and button dropdown.

For example, I wanted to filter process explorer to the value I selected among "table"."column", so I used a variable and a button dropdown. If the button dropdown is set to "table"."column" and the filter is set to FILTER "table"."column" = <%=variable_name%> in process explorer, if I don't select button dropdown, process explorer has syntax error occurs. In order to prevent this case, I want to set the default value using casewhen or if statement.

Hi,

You can maybe try a longer statement in the variable.

For example: Instead of putting a component filter like  'FILTER "table"."column" = <%=variable_name%>' you can try this: 'FILTER <%=variable_name%>' and the variale_name can hold this: "table"."column" ='Value'(that you want) the whole statement sgould be in the variable instead of just the value you want.

So now if you want to set a default value you can just try 'FILTER <%=variable_name%>' and the variale_name can hold this: "table"."column" is not null. You can create one more dropdown for the default value which will write the above statement to the variable. This will select all the values. And hopefully you won't get the error.

Let me know if this helps :)

 

Thanks,

Divya


Hi,

You can maybe try a longer statement in the variable.

For example: Instead of putting a component filter like  'FILTER "table"."column" = <%=variable_name%>' you can try this: 'FILTER <%=variable_name%>' and the variale_name can hold this: "table"."column" ='Value'(that you want) the whole statement sgould be in the variable instead of just the value you want.

So now if you want to set a default value you can just try 'FILTER <%=variable_name%>' and the variale_name can hold this: "table"."column" is not null. You can create one more dropdown for the default value which will write the above statement to the variable. This will select all the values. And hopefully you won't get the error.

Let me know if this helps :)

 

Thanks,

Divya

Thanks for the good comments!

Before seeing your comment, I solved the problem in a different way.

FILTER ("table"."column" = '<%=variable_name%>') or ('<%=variable_name%>' = and "table"."column" in ("table"."column"))

Thank you, I hope you have a nice day

Sanghyeok


Reply