SQL IN Statement
I need some help doing the following.
1. I querry a layer on an id. This generates multple features with this id.
2. I want to use a sql statment with the IN function in my set layer definition, so using a for each a build a string which end up looking like this, this is a different locationid: (1,2,3).
3. Then i use the following expression in the layer definition =`DIFFERENTLOCATIONID' IN '${$test.result}'`. Test result being the (1,2,3). This will hopefully filter out on this diferentid.
I tested this querry in the REST API and it works. Why is this not wokring in Vertigis. The layer crashes when trying to execute.
-
Try adding brackets around the numbers: SQL IN Operator (w3schools.com) so the resultant where clause looks like this:
DIFFERENTLOCATIONID IN (1,2,3)
0 -
=`DIFFERENTLOCATIONID IN (${$test.result})` When i use it like this and removed the brackets from the input string it works! Thankyou!
0 -
No need to remove brackets if you do this $test.result.join(",")
0
Please sign in to leave a comment.
Comments
3 comments