8 Replies Latest reply on Oct 15, 2015 7:17 AM by Joe Oppelt Branched to a new discussion.

    URL action filter "All"

    Mory Padilla

      I'm experiencing odd behavior when allowing "All" to be an option on a filter.  For example:

      If the user selects "All", and then clicks on a button to send a url action with "?Division=<FILTERVALUES(Division)>" the resulting url will include all divisions in the data source (not just "Tealwood Division").  This can be a problem when the url is too long and the page fails to load.  Even if the url is not too long, the filter is not set.

       

      Another odd thing is that if the user just selects "Tealwood Division" , "All" will show up as checked as well.  However, when the user clicks the button with the url action, the url correctly contains only "Tealwood Division" and the page loads properly.

       

      Does anyone have a workaround that allows the user to select "All"?

        • 1. Re: URL action filter "All"
          Chale Dodge

          Hi Mory,

           

          could you create a worksheet that shows each of your division entries and then create a URL action off that rather than the filter?

           

          also are you using Tableau Desktop or Server for this?

           

          I am not sure what you are trying to do with the URL action - could you expand on that a bit further? maybe even with a sample workbook to better understand your problem?

           

          Regards

          Chale

          • 2. Re: URL action filter "All"
            Alfredo Pirrone

            Hi Mory,

             

            Please take this answer as an hypothesis rather than as hard knowledge on this issue. 

             

            When you activate the URL Action from a sheet that does not reference the filter fields, FILTERVALUES will report  the last selected values. Therefore, in your case, if the division quick filter was set to All values and its visible options were reduced afterwards as a consequence of setting another filter, the activation of your URL Action will cause FILTERVALUES report All values from the data set. This will also be the case if you select All Values even though you only see a single option.

            On the other hand, if the division filter was set to none and then you just select one visible option, the All option will self-select (because it is the only visible option) but Tableau will remember that you just checked one option and report the FILTERVALUES with only that value.

             

            If this is not what you want, add the filter fields to the activating sheet by adding then to the detail tile. Play with format options to hide the values from the view if necessary.  By doing this, the FILTERVALUES will include only the values displayed in the view.

             

            Unfortunately, FILTERVALUES reports a list of all options available when you choose ALL. Therefore, if there are many options, then you will have problems as the URL will get too long. I don't know how to avoid this.

             

            Let me know if this makes sense for your situation.

             

            yours,

            Alfredo

            1 of 1 people found this helpful
            • 3. Re: URL action filter "All"
              Mory Padilla

              Thanks for the responses.

               

              Alfredo, I believe that pretty much sums it up.  In this case, I will probably set the filter to default to none, remove the all option, and add the built in apply button.  If anyone knows a workaround to the "all" option it would still be appreciated in case I have to deal with this issue in the future.  Unfortunately, adding the field as a detail doesn't work in my scenario because I am using an image to trigger the action.  If I add the field as a detail, having multiple selections in "division" would cause multiple images.

              • 4. Re: URL action filter "All"
                Joe Oppelt

                See attached.

                 

                You can build your URL in a calc field and then put the calc field in the Hyperlink filter instead of a hard-coded URL.

                 

                In sheet1 I call GOOGLE with the selected department the user clicks.

                 

                In sheet 2 I put a department filter on the sheet.  If the user selects ALL, I just call GOOGLE without a search string.  If the user selects one department, I call GOOGLE with that department as the search string.

                 

                One way to tell if ALL is selected from a filter is to right click on your data source and choose DUPLICATE.  Then you can compare COUNTD from the copy (don't select a blend field, even though Tableau yells at you) with COUNTD from the original.  If they match, the user has selected ALL.  If not match, the the user has a subset.

                 

                Attached is 8.2 version workbook using superstore.

                • 5. Re: URL action filter "All"
                  Alfredo Pirrone

                  Hi Joe


                  Thank you for your contribution.  Let me ask you something: Is there a way to build in a calculated field all the selected options of a filter? the function FILTERVALUES() is not available for calculated fields. Only in URL of URL Actions.

                   

                  As far as we have a single value filter, we could indeed use a calculated field to produce the URL as you suggested, but in this case, couldn't we simply add the field to the URL itself?   It is different when we have a multiple values filter: Creating a calculated field with the multiple selections may allow us to control the line length, and also how to act if ALL of the options are selected.

                   

                  An additional comment: from Tableau 9.0 it is possible to use LOD expressions. They will allow you to avoid the double reference to a data source in order to use different levels of aggregation. An alternative to your 8.2 formula that will work only in Tableau 9.0 or 9.1 would be:

                   

                  Screen Shot 2015-10-13 at 9.41.30 PM.png

                  Yours,

                  Alfredo

                  • 6. Re: URL action filter "All"
                    Joe Oppelt

                    Alfredo Pirrone wrote:

                     

                    Hi Joe


                    Thank you for your contribution.  Let me ask you something: Is there a way to build in a calculated field all the selected options of a filter? the function FILTERVALUES() is not available for calculated fields. Only in URL of URL Actions.

                     

                    As far as we have a single value filter, we could indeed use a calculated field to produce the URL as you suggested, but in this case, couldn't we simply add the field to the URL itself?   It is different when we have a multiple values filter: Creating a calculated field with the multiple selections may allow us to control the line length, and also how to act if ALL of the options are selected.

                     

                     

                     

                    Yeah, FILTERVALUES isn't available in a calc.

                     

                    The URL action in that example would also work if I put this in the URL line in the action dialog box:

                     

                    www.google.com/?gws_rd=ssl#q=<Department>

                     

                    So I'm guessing that you could play with mixing some CALC and some hyperlink syntax together and still use FILTERVALUES in the action itself.

                     

                     

                     

                    An additional comment: from Tableau 9.0 it is possible to use LOD expressions. They will allow you to avoid the double reference to a data source in order to use different levels of aggregation. An alternative to your 8.2 formula that will work only in Tableau 9.0 or 9.1 would be:

                     

                    Screen Shot 2015-10-13 at 9.41.30 PM.png

                    Yours,

                    Alfredo

                     

                    I know I could have done LOD.  Too many times on this forum, though, people are still on 8.x, so I just went with that and just said that it was "one way" to do it.  The point of my reply wasn't how to decide what to put in the URL string.  It was just to show that it's possible to have a conditional value in the URL.

                    • 7. Re: URL action filter "All"
                      Alfredo Pirrone

                      Hi Joe

                       

                      I hope that I have not given the impression that I wanted to prove smarter than you or anyone else. I added my LOD comment for  I looked at the thread and felt that people that are in 9.x would appreciate the call for an LOD version. In fact, probably there are better LODs for this case than the one I proposed.

                       

                      I admire those of you who have managed to provide so much insights and support to others than actually achieved  the top ranks. I really love this tool and have learnt a lot just reviewing questions from others and trying to addressed issues that, by the time I figure out what to do, a better solution has already been posted.

                       

                      Thank you.

                       

                      Yours,

                      Alfredo

                      • 8. Re: URL action filter "All"
                        Joe Oppelt

                        Alfredo -- You did not give that impression at all.


                        Every post like that adds value for the next guy who is looking for help in a particular area and pulls up our replies!

                         

                        Never hold back when you can add value.