6 Replies Latest reply on Jan 2, 2018 8:16 PM by cyu cc

    ApplyRangeFilterAsync does not work as expected

    cyu cc

      Dears, I've create a sheet with very simple datasource and chart as follow:

      DataSource.pngSheets.pngFilterSetting.png

      I published the workbook to my local tableau server and then access it with JavaScript API. I tried to change the 'Date' filter with ApplyRangeFilterAsync, but it does not work as expected. If the API is called with any NullOption(NULL_VALUES/NON_NULL_VALUES/ALL_VALUES), the filter will be changed to an "ALL value" filter(means getMin().value=null, getMax().value=null, getIncludeNullValues()=true).

       

      Another question, with API calling, we can find that a filter of "Only NULL"(Edit filter-->Special values-->NULL) and a filter of "All values"(Edit filter-->Special values-->All values) [See the last picture]have the same attributes(getMin().value=null, getMax().value=null, getIncludeNullValues()=true), how to know one of them from another by JS API?S

        • 1. Re: ApplyRangeFilterAsync does not work as expected

          Hi cyu cc,

           

          Would you be able to attach a workbook please, so we can try to reproduce this issue ourselves?

          Thanks,

           

          ----------

          Lénaïc RIÉDINGER, Global Community Engineer Tableau

          Tableau Community Forums | Knowledge Base

          If you see a Helpful or Correct response, please mark it thanks to the buttons below the targeted post!

          • 2. Re: ApplyRangeFilterAsync does not work as expected
            cyu cc

            Dear Lénaïc RIÉDINGER, thank you for reply. The workbook and html page for test are attached. My tableau server version is 10.3 (64 bit).

             

            The workbook contains seven sheets, all of them have same row and column. Every sheet has a separate filter named ‘Date’, the only difference is the filter status, and you can find the difference by ‘Edit Filter’ in tableau desktop. I named the seven statuses from 1 to 7, means:

            1.Only NULL ---- via special values
            2.Part date (not include NULL) ---- via date range
            3.Part date (include NULL) ---- via date range
            4.All date (not include NULL) ---- via special values
            5.All date (not include NULL) ---- via date range
            6.All date (include NULL) ---- via special values
            7.All date (include NULL) ---- via date range

             

            The html page is used to test ‘applyRangeFilterAsync’ and ‘clearFilterAsync’ functions. Once one of them is called, a ‘getFiltersAsync’ function will be called to display the new filter status. Operations and filter status will be displayed in the left-bottom area. An operation is showed as ‘C’ (means clear filter) or ‘A(m,n)’ (means apply filter with range option m and null option n), where m should be 1 (means with a customized range, i.e. 6 months ago till now) or 2 (means with the domain range of the filter, achieved by getDomainMin/getDomainMax), and n should be one of 0/1/2/3 (0 means apply without null option, 1 means with null option NULL_VALUES, 2 means with null option NON_NULL_VALUES, 3 means with null option ALL_VALUES). Filter status is the value described in the workbook section, and is determined by the setting values (getMin/getMax) and IncludeNullValues flag, for detail process see the function ‘getFilterStatus’ in the html file (Line #173). As mentioned in the initial post, I cannot know status 1 from status 6:

            Another question, with API calling, we can find that a filter of "Only NULL"(Edit filter-->Special values-->NULL) and a filter of "All values"(Edit filter-->Special values-->All values) [See the last picture]have the same attributes(getMin().value=null, getMax().value=null, getIncludeNullValues()=true), how to know one of them from another by JS API?

             

            Before running the test html, please update the server IP (Line #7) and workbook URL (Line #16) you published to.

             

            After running the test, I got a filter status converting list as below:

            Status

            A(1,0)

            A(1,1)

            A(1,2)

            A(1,3)

            A(2,0)

            A(2,1)

            A(2,2)

            A(2,3)

            Clear

            1

            1

            6

            6

            6

            1

            6

            6

            6

            5

            2

            2

            6

            6

            6

            5

            6

            6

            6

            5

            3

            3

            6

            6

            6

            7

            6

            6

            6

            5

            4

            4

            6

            6

            6

            4

            6

            6

            6

            5

            5

            2

            6

            6

            6

            5

            6

            6

            6

            5

            6

            6

            6

            6

            6

            6

            6

            6

            6

            5

            7

            3

            6

            6

            6

            7

            6

            6

            6

            5

            In the table, first column is the initial status, other columns means converting-to status after specified operation in the first row. For example, the red cell means after running A(1,2) (detailed operation information is: applyRangeFilterAsync(A) with a customized range(1) and NON_NULL_VALUES null option(2)), a filter of status 3 is converted to status 6 (I don’t think it is the expected status).

             

            It is really hard to describe all of these. Hope you can understand.

            • 3. Re: ApplyRangeFilterAsync does not work as expected
              cyu cc

              Hi,Lénaïc RIÉDINGER, do you have any new thought about this post?

              • 4. Re: ApplyRangeFilterAsync does not work as expected

                Hi cyu cc,

                 

                My apologies for the delay in getting back to you.

                I was hoping that some JS API experts could jump in as this is not my spe.

                Would you be able to create a case with our customer support please?

                Support Case | Tableau Software

                 

                Let me know you #Case number so I can chime in.

                Thanks for your understanding and patience!

                Happy holidays season

                • 5. Re: ApplyRangeFilterAsync does not work as expected
                  cyu cc

                  case #: 03511995

                   

                  Thanks!

                  • 6. Re: ApplyRangeFilterAsync does not work as expected
                    cyu cc

                    Update: Tech support team has reviewed the case and found that while calling the api, 'nullOption' field in the RangeFilterOptions should be 'NullOption' (currently 'nullOption' in the API ref document, should be changed to 'NullOption', see the attachment), but the null option is not applied to the filter regardless of the values. After changing 'nullOption' to 'NullOption' in the sample code, the new status matrix changes to:

                     

                    StatusA(1,0)A(1,1)
                    A(1,2)
                    A(1,3)
                    A(2,0)
                    A(2,1)
                    A(2,2)
                    A(2,3)
                    Clear
                    1111111115
                    2222255555
                    3333377775
                    4444444445
                    5222255555
                    6666666665
                    7333377775