13 Replies Latest reply on Oct 3, 2018 8:06 AM by Joe Oppelt

    How can I maintain filtered context when jumping to new dashboard through URL action?

    Jose Jarabo

      Hello,

          

           So long story short. I have a dashboard that contains various worksheets which are being filtered by about 5 different filters at the top. I want the ability for a user to click on one of the items in these workbooks which will call an action to open a URL to a more detailed view of that item. The most important element that I need to include in this is that the filter context currently applied in the dashboard carries over to this new URL.

       

      So for example. Say in the main dashboard I have 5 filters setup. 1 filter is filtering for only Apples and Oranges, and a second filter is only filtering for Juice and extract. When I click on a juice type listed in the Juice worksheet within this dashboard it should open a detailed dashboard about the juice but only show details related to apples and oranges and no other fruit since Apples and oranges are the selected filter in the current context of the primary dashboard.

       

       

      Any assistance with this would be greatly appreciated.

       

       

      Thanks

        • 1. Re: How can I maintain filtered context when jumping to new dashboard through URL action?
          Joe Oppelt

          You can build a table calc that creates a list of all the values selected on the sheet.

           

          I'm looking for an article that I know describes how-to really well.  Here is another I found:

           

          https://kb.tableau.com/articles/HowTo/creating-a-string-list-to-display-in-a-tooltip

          • 2. Re: How can I maintain filtered context when jumping to new dashboard through URL action?
            Joe Oppelt

            OK, I found a link that gets to the demo.  Go here:

             

            Tableau Public

             

             

            Across the top are tabs.  Go to Tab 15.  That's what you want to do.

             

            Once you have that calc, you'll need to use it to insert the list of values into the filter values that you pass to destination sheet in the URL.

            • 3. Re: How can I maintain filtered context when jumping to new dashboard through URL action?
              Jose Jarabo

              Thanks Joe.

               

              I am going to take a look at this and let you know.

              • 4. Re: How can I maintain filtered context when jumping to new dashboard through URL action?
                Jose Jarabo

                So I tried to implement it but ran into an issue where I am getting duplicate values for it. Example.

                 

                The Rows contain values of none, low, medium, high, critical.

                 

                When implementing the above I am getting multiple Medium, High, Lows etc.

                 

                Additionally it looks like if I add an additional quick filter to the data, it then cleans out all of it and leaves it as a single value(high) without including all the other valid results.

                • 5. Re: How can I maintain filtered context when jumping to new dashboard through URL action?
                  Joe Oppelt

                  The calc is cycling through the underlying table, pulling values that are in the table.  (It's not reading a filter structure or anything like that.)  So if you filter out values, they are no longer in the table.  You're only going to get what's in the table.

                   

                  Further, you'll need to tell tableau the order of dimensions you want it to cycle through.  Defaults are usually either Table(down) or Table(across), but you may need to tell it to do a different order.

                   

                  And the only way I can tell you how to do that is to show you in a sample of your workbook.  I'd be glad to do that, but I need something physical to work with.

                   

                  If your data set is inordinately large or if you have proprietary data you don't want to upload here, follow the instructions in this video:

                   

                  Video demonstrates how to anonymize your workbook/data

                  • 6. Re: How can I maintain filtered context when jumping to new dashboard through URL action?
                    Jose Jarabo

                    Ill work to try to anonymize it today and send you something later today.

                     

                    Thanks for your assistance.

                    • 7. Re: How can I maintain filtered context when jumping to new dashboard through URL action?
                      Jose Jarabo

                      Here you go Joe.

                      I set up the scenario I am currently dealing with in the sheet. It currently only displays 1 of the values it should. If you remove the Assettag filter from quick filters you will see the other issue I ran into.

                       

                      Tableau Public

                       

                      Thanks

                      • 8. Re: How can I maintain filtered context when jumping to new dashboard through URL action?
                        Joe Oppelt

                        See attached.

                         

                        Sheet (2) has some added stuff.  First, I created a calc, [index] . Whenever I'm messing with table calcs, I do this for myself.  I want to see what Tableau sees.  Index tells me the order that tableau is walking the table.

                         

                        Notice the setting I used for index so that I get 1-through-N for the Severity values on the sheet.

                         

                         

                        Normally once I get index to behave the way I need, I can set my other table calcs the same, and they will behave the same way.

                         

                        See then changes I made to [Filtered Severity Feed].  Very much simplified from what you had.  Grab the first value if I'm at index=1, and add the current value if I am at any other index value.  This is displayed on the sheet.  One thing came up disappointing for me though.  Notice the last row in the "Low" chunk.  It didn't propagate the both "High" and "Low" onto the line.  I see why.  It has a row in the prior Severity chunk, AND it's not the first in the current chunk.  I don't like how that's behaving, but it's not important to the overall operation here.  I didn't devote time to figuring out how to get it to behave.

                         

                        Something important to note.  For the table calc setting for [Filter Severity Feed], I have to make sure that the table calc itself is set correctly, AND that the nested calc(s) (in this case, index) is/are also set the way I want.  See here:

                         

                         

                        I am editing [Filtered...], but there is a pulldown arrow for nested calcs.  If you pull that down you will see [index] in there.  Click on [index] and you will see the settings for it within the [Filtered...] table calc settings.  There are times when one calc is set one way and another is set a different way.  Deliberately and correctly so.  (I'll show you one later.)

                         

                        Just as a matter of demonstration, BTW, see sheet (2A).  I swapped the order of dimensions on ROWS.  Because I specified dimension names in the table calc settings, the values on each row match what is on the prior sheet.

                         

                        Go to Sheet 47(3).  I made another calc.  See [Final String].  This grabs the max value among all the [Filtered Severity Feed] values on the sheet.  I displayed this in the title.  (this is why the behavioral anomaly of [Filtered...] wasn't important to me earlier.)  Edit the table calc settings for [Final string].  You'll see that it's doing table(down).  Essentially I'm saying here to grab the biggest of all the values, regardless of what [Severity]/[Asset] combo contains it.  Notice that this calc is table(down), but the nested calcs are set like we saw on Sheet(2).

                         

                        Look at sheet (4).  Here I played with setting the [Filtered...(copy)] only on the first occurrence of a row within each severity.  (Edit the (copy) version to see how I did that.)  I am displaying two index values.  The first one is the setting we used before.  The second one is cycling through each row within each [Severity].  (Check out the setting for index(copy).)  It's not necessary for your purposes, but I just thought I'd show you that to show how you can manipulate how tableau walks the table.  Both the [index] and [index (copy)] calcs are nested in the new [Filtered...(copy)] calc.

                         

                        Go to Sheet (5).  Finally I created one more calc.  See [URL STRING].  This is how you are going to use it on the URL line.  Notice that [URL STRING] (which is displayed in the title) has to have table calc settings too.

                         

                        For the record, I think you're going to want to remove the spaces added with the commas in [Final...].  I think those spaces are going to mess up the URL.

                         

                        If you have to insert a space (for instance, if you have a field name that contains a space) then shove %20 in there.  Here is a piece of a URL calc I have where I'm passing parameters that have names in the field names:

                         

                         

                         

                        "?End%20Analysis%20Period="+STR([End Analysis Period]) +

                        "&End%20Date="+([End Date]) +

                        "&Start%20Date="+[Start Date] +

                        "&Start%20Analysis%20Period="+STR([Start Analysis Period]) +

                         

                        To pass the calc field [URL STRING] as your URL, have [URL STRING] as I do on sheet (5), and then in your action on that sheet, just pass the calc field rather than a hard-coded URL string.

                         

                        Here is a piece of my dashboard where I do this.  When the user clicks on the 29 (circled) on this dashboard, the URL action activates.  I am showing the edit screen for that action here:

                         

                         

                         

                        On the URL line of the action is an arrow (circled).  This will contain the fields that are on the sheet.  Select your calc, and it will transfer the contents (at run time) to the action.

                        • 9. Re: How can I maintain filtered context when jumping to new dashboard through URL action?
                          Joe Oppelt

                          Regarding the Assettag filter.

                           

                          The table calc is cycling through the rows in the table underlying the sheet.  When you filter the rows further with Assettag, you reduce the rows in the table.  Tableau can only look at what's in the table.  Take sheet 47(2) and add the assettag filter.  You'll see that you'll only get the Severity values that are remaining after that filter activates.


                          That's the law.  you can't change that.

                          • 10. Re: How can I maintain filtered context when jumping to new dashboard through URL action?
                            Jose Jarabo

                            I took a look and thank you so much... Now just to make sure I am on the same page as you.. In order for this to work any "Filter" that I want to do this with the dimension will have to be part of the worksheet and be displayed on it some how?

                             

                            I ask because I guess I will have to add a ton of these as columns at the end of the data I actually want to show then use some visual tricks to hide this. So end of the day the worksheets I will have in the dashboard will be Top N worksheets by volume, others by age, etc which shouldn't be showing severity and or patchability for example.

                             

                             

                            Thanks again.

                            • 11. Re: How can I maintain filtered context when jumping to new dashboard through URL action?
                              Joe Oppelt

                              Jose Jarabo wrote:

                               

                              I took a look and thank you so much... Now just to make sure I am on the same page as you.. In order for this to work any "Filter" that I want to do this with the dimension will have to be part of the worksheet and be displayed on it some how?

                               

                              ...

                              Maybe, and maybe not.

                               

                              You can see that the table calc is certainly walking through that specific dimension, so it has to be on SOME sheet somewhere.  But if you don't want that dimension on your sheet, chances are if you add it to the sheet you're going to screw up the viz.  (Actually, we can often handle the multi-mark result of an added dimension.)  But you could have a second sheet that uses all the same filters (via the "Apply to" feature for filters.)  In fact, it could be a separate button that you would use to activate the URL Action.  And it could have all the filtered dimensions instead.  (Just thinking out loud here.)

                              • 12. Re: How can I maintain filtered context when jumping to new dashboard through URL action?
                                Jose Jarabo

                                Ok how about this scenario for what you suggested.

                                 

                                1 Worksheet "hidden" in the Dashboard that contains all these calculated fields and necessary logic with the data.. Then the button, along with a Filter action when selecting an item on one of the other worksheets that would filter the hidden worksheet by that item and the button would then trigger the URL?

                                 

                                Think I can enable disable the button through Parameters maybe? Could possibly also include that on the selection actions.

                                • 13. Re: How can I maintain filtered context when jumping to new dashboard through URL action?
                                  Joe Oppelt

                                  I thought about it more after I posted that last reply.

                                   

                                  In fact, the button would be that extra worksheet.  It would have all the dimensions and all the filters applied to it.  You would display only one actual mark by filtering to index=1 (which would retain all the rest of the underlying table intact, so the table calcs would work correctly).  Display a shape as that mark, and some text on it saying "click here blah, blah".