1 Reply Latest reply on Aug 9, 2018 4:45 AM by Antti Koljonen

    Problem with filtering query views (REST API)

    Antti Koljonen



      I am trying to pull csv data from Tableau Server using REST API and the Query View Data method (https://onlinehelp.tableau.com/current/api/rest_api/en-us/help.htm#REST/rest_api_ref.htm#Query_View_Data). The basic query works smoothly, but I have problems when trying to filter query views (https://onlinehelp.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_filtering_and_sorting.htm#Filter-query-views). Server version is 2018.1.1.


      There are several fields in the underlying data, and with some of the fields filtering works just fine, but with others I cannot get it to work. For example, in my case one field contains names of people and another field contains names of companies. Filtering by a person’s name works every time but filtering by company name does not. Every time when I try to filter by company name, I get an empty result set, which seems to indicate that the field name is recognized but the filter value is not. This happens with simple filter values with no special characters. Both fields have the same data type (string), they come from the same database table and the datasource uses an extract. This is really confusing because I cannot figure out any obvious reason why filtering query views works with some of the fields and not others.


      Has anyone else encountered a similar situation? Any ideas what might be the cause or how I could further debug the issue?

        • 1. Re: Problem with filtering query views (REST API)
          Antti Koljonen

          I did some more testing and I think I may have found the potential cause. I noticed that in some cases the string values in the company name field contain the name of the city where the company is located, and the city name is separated from the company name by a comma or a dash. I started to suspect that these special characters could be problematic.


          I duplicated the company name field and got rid of all special characters by editing aliases. And after that filtering started working! Furthermore, as soon as I cleared the aliases, filtering did not work any more. Seems obvious to me that the field values are somehow causing the problem, but I haven't seen this documented anywhere, so can anyone confirm my findings?