You can translate the question and the replies:

WebService REST

Hi, I'm developping an application that interacts with an instance of denodo. I need to make a query with two "in" conditions but apparently it doesn't work. This two query works fine 1 - filter = UrlEncode("TRIM(""aff_etat_iep"")NOT IN ('Supprime','Archive')") http://myserver.com:9090/denodo-restfulws/data_access_p/views/iep_affaires?$select=aff_id&$filter=TRIM(%22aff_etat_iep%22)NOT+IN+(%27Supprime%27%2C%27Archive%27)&affaires_ctre_id=21&$format=JSON&$start_index=0&$count=100 2 - filter = UrlEncode("TRIM(""ccs_id"") IN (9187,9202,9206,9205,9204,9203)") http://myserver.com:9090/denodo-restfulws/data_access_p/views/iep_affaires?$select=aff_id&$filter=TRIM(%22ccs_id%22)+IN+(9187%2C9202%2C9206%2C9205%2C9204%2C9203)&affaires_ctre_id=21&$format=JSON&$start_index=0&$count=100 But when I try to cumul both filters I've got {"errors":[{"message":"The field 'TRIM(\"ccs_id\") IN (9187,9202,9206,9205,9204,9203)' does not exist."}]} http://myserver.com:9090/denodo-restfulws/data_access_p/views/iep_affaires?$select=aff_id&$filter=TRIM(%22aff_etat_iep%22)NOT+IN+(%27Supprime%27%2C%27Archive%27)&TRIM(%22ccs_id%22)+IN+(9187%2C9202%2C9206%2C9205%2C9204%2C9203)&affaires_ctre_id=21&$format=JSON&$start_index=0&$count=100 if I change order of filters erreurs changes to {"errors":[{"message":"The field 'TRIM(\"aff_etat_iep\")NOT IN ('Supprime','Archive')' does not exist."}]} Is there another way to cumul both filters, currently I'm using "&" opeerator. Thanks in advance
user
07-03-2019 05:10:47 -0500
code

3 Answers

Hi, I was able to run the Web Service successfully with more than one condition, by providing Input Parameters separately for each condition. In your case, I would add the parameter **$select** or **$filter** after each condition (i.e., after each ‘&’ operator). For more details, take a look at [Input Parameters of the RESTful Web Service](https://community.denodo.com/docs/html/browse/7.0/vdp/administration/restful_architecture/restful_web_service/input_parameters_of_the_restful_web_service#parameters-supported-by-the-denodo-restful-web-service-and-published-rest-web-services) section under the Virtual DataPort Administration Guide. Hope this helps!
Denodo Team
08-03-2019 06:36:28 -0500
code
Hi, That's what I did, my query is using $filter : http://myserver.com:9090/denodo-restfulws/data_access_p/views/iep_affaires?$select=aff_id&$filter=TRIM(%22aff_etat_iep%22)NOT+IN+(%27Supprime%27%2C%27Archive%27)&TRIM(%22ccs_id%22)+IN+(9187%2C9202%2C9206%2C9205%2C9204%2C9203)&affaires_ctre_id=21&$format=JSON&$start_index=0&$count=100 Problem is present with two $filters of type "NOT IN" using & operator.
user
11-03-2019 04:11:13 -0400
Hi, I noticed that you did not make use of Input Parameter ($select, $filter, $format, etc) after the **‘&’ parameter** in your URL. I executed a similar query with more than one condition like the one below, ``` http://localhost:9090/denodo-restfulws/myDatabase/views/base_view?$filter=country_id in ('AR','CA','CN','CZ')&$filter=region_id not in (1) ``` In my case, I used **$filter** parameter for each condition and was successful in retrieving the results. Hope this helps!
Denodo Team
18-03-2019 08:00:34 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here