1 2 Previous Next 24 Replies Latest reply on Sep 27, 2016 9:15 AM by mark.welsh

    "Print" button on dashboard that will open current filtered state as pdf

    mark.welsh

      Ok, I know how to set a URL on an image that can be clicked and the dashboard will appear as a pdf in its default state.  Of course, I don't want default state I want current state based on quick filters selected.  I'm reading that I need to create a calculated URL that gets the current quick filter values and reference that URL in the 'set URL' box. 

       

      If this is what I need to do, can someone help me create the calculated field and/or URL?  And then explain how to use it in the set url box.

       

      Many many many thanks.

        • 1. Re: "Print" button on dashboard that will open current filtered state as pdf
          Joe Oppelt

          If you're going to build the URL via a calculated field, you can't hook it to an image.  A calc field will have to be hooked to a sheet.

           

          BUT!!!

           

           

           

          You can make the image the background image of a sheet, design the sheet so that it has one mark, and hook a hyperlink action to that sheet so that when the user clicks on the sheet it does what you want.

          1 of 1 people found this helpful
          • 2. Re: "Print" button on dashboard that will open current filtered state as pdf
            Joe Oppelt

            Here is an old example I have using a calc field (Calculation1) to build a URL and get used as a hyperlink action.

             

            There are two hyperlink actions on this sheet.  One uses Calculation1 to call Google with the [Department] in the string.  The other adds [Department] to the URL on the URL line in the hyperlink action itself.

            1 of 1 people found this helpful
            • 3. Re: "Print" button on dashboard that will open current filtered state as pdf
              mark.welsh

              Thanks Joe!

               

              Of course I have some questions:

              1. How do I design a sheet so that it has only one mark for multiple "Categories"?
              2. Will this method allow them to "print" the dashboard when ALL Categories are selected?
                1. How would that work with only one mark to click?
                2. Would I need to create a calculated field that said ' if count(category) >1 then 'ALL' else [category] '  ??
              3. Adding a background image doesn't appear to be as simple as I'd hoped.  I tried adding a custom Shape to my Shapes folder, but Tableau wouldn't recognize the .png file...[Edit]: I also tried the Map>background image, but honestly I couldn't make sense of it.

               

               

              • 4. Re: "Print" button on dashboard that will open current filtered state as pdf
                Joe Oppelt

                Not as clean as I had thought it was going to be.

                 

                When I made my suggestion I was thinking back to the time I did precisely this (except I had the URL do ".CSV" for an excel file instead of ".PDF".)  But I went back to that workbook, and I realized that all the filter values I was passing were actually parameters, not filters.  With parameters, we always have only one value, never multiple.  So the "one mark" idea worked for me because of that.


                In the attached I created a little dashboard as before, and there is a smiley-face (I hope it propagates for you in the TWBX) from a custom shape.  I forced the filter to be a single-select filter because yes, if we select two values and I have only a single-mark icon-sheet, it grabs only one of the filter choices.


                If you need multiple filter choices ...  ummm ...  we're going to have to try something else -- if there even IS a "something else".

                 

                But as you suggested, we CAN pass either "all" or the single value, except we can't simple pass the string "all".  We have to pass all the possible values.  See [Calculation2] in the "Dummy Button" sheet.

                 

                Of course, you'll have to change your server string in that calc. 

                 

                But I just tacked on ".PDF", and the published dashboard comes up either with the single value selected, or all values if that's what the user selected.

                 

                As for not being able to add your image to the custom shapes, I'm not sure why you couldn't get your PNGs to load.  I use them all the time.

                 

                 

                There are a ton of papers out there about adding shapes.  I'm sure you've seem many of them.  What behavior are you seeing?

                1 of 1 people found this helpful
                • 5. Re: "Print" button on dashboard that will open current filtered state as pdf
                  mark.welsh

                  Thanks again Joe!  Before I dig too deep into your response I wonder if we can work with a recent discovery I made.  Jonathan Drummey posted a viz on how to make a string list out of quick filter selections.  I copied his formulas (although I don't yet have a clue how they work) and I'm able to create a string list of the selected quick filters, be it one, two, three or All.  I can use that calculated field in my URL and it opens a .pdf with only the quick filters selected! 

                   

                  I'm hopeful that this will continue to work for my application, so the next question is how to format a sheet so that the user will only be presented with one possible selection to click on and ideally that selection would be a nice little ".pdf" image of some sort.  I think I could make text work as well. 

                   

                  As far as the shapes go, I added a folder here C:\Users\1234\Documents\My Tableau Repository\Shapes called "My Image" and added a .png file.  When I go to find it in Tableau the folder isn't there.  I've closed and re-opened Tableau a few times and reloaded the shapes as well. 

                   

                  • 6. Re: "Print" button on dashboard that will open current filtered state as pdf
                    Joe Oppelt

                    There is a RELOAD SHAPES button on that screen shot.  What happens when you click that?

                     

                    As for the single mark, see attached.


                    I forgot about the PREVIOUS_VALUE function.  What Jonathan is doing is there is leveraging the PREVIOUS_VALUE function to sequentially concatenate the series of Containers (in his example.)  I modified my example to do Departments.

                     

                    And then, in the "dummy button" sheet, look at the INDEX filter.  It's a table calc that just grabs the index value of each mark (in this case, processing TABLE(across), which is the default) and just displays the first one.

                     

                    Take INDEX off filters.  You'll see that there are as many marks as there are Departments selected.  But with that filter, it just displays the first one.  And you'll see in tooltips (when the filter is off) that the value of [Filtered Departments] is the same from mark to mark, so you only need to display one.


                    And this is the sweet part.  The INDEX calc is a table calc.  When you filter by a table calc, it doesn't throw out rows from the underlying table.  It just filters which part of the underlying table to display.  So the rest of the table is there (which is why the [Filtered Departments] calc still works), but only a part of it is displayed.

                    1 of 1 people found this helpful
                    • 7. Re: "Print" button on dashboard that will open current filtered state as pdf
                      mark.welsh

                      INDEX!!  This is great.  I think we're getting close. 

                       

                      So, I think the last hurdle is the shapes conundrum.  As I mentioned above, the reload button does nothing for me...I also tried adding a custom .png to one of the existing shapes folders to no avail.  I'll see if I can find some similar cases online and go from there. 

                       

                      You're help has been legendary as usual.

                      • 8. Re: "Print" button on dashboard that will open current filtered state as pdf
                        mark.welsh

                        Apparently I have a few different Tableau folders on my machine.  One is local and the other is on a network share.  I'm not sure what's going on with all of that, but the Shapes folder I needed was on the network share.

                         

                        However, the custom shapes are only showing up as circles!  I've attached one of the .png files I'm trying to use.

                         

                        EDIT: Changed the attached file to JPEG and it works! 

                        • 9. Re: "Print" button on dashboard that will open current filtered state as pdf
                          Joe Oppelt

                          My pathname is

                           

                          C:\Users\Oppelt\Documents\My Tableau Repository\Shapes\test shapes

                           

                          I had 3 shapes in the "test shapes" folder.  One was named "Smile.jpg", another was "pic 4.png".


                          Here is something I discovered with adding shapes to an existing folder.  If I don't add a file that lands last alphabetically, Tableau does weird (and unexplainable) things to me.  And yes, when I added PDF.PNG, I was perfectly able to find it when I did REFRESH, but when I cicked it to replace the Smiley with the PDF file, Tableau selected the "Pic 4.PNG" shape.

                           

                          I renamed PDF.PNG to xPDF.PNG and that put it at the end of the list, did REFRESH, and Tableau selected it without problems.  See attached.

                          • 10. Re: "Print" button on dashboard that will open current filtered state as pdf
                            mark.welsh

                            Thanks Joe.  When I changed the filed back to a JPEG it worked perfectly.  Here it is in the corner of my dashboard

                             

                            • 11. Re: "Print" button on dashboard that will open current filtered state as pdf
                              Joe Oppelt

                              People who sit around my cubicle know that I talk to Tableau.  And the most common thing I tell it is this:  "You won't beat me!"

                               

                              There are so many ways to cobble together tricks and come up with something that does the job.  This was fun to play with.  And I resurrected a forgotten tool in my bag of magic tricks:  PREVIOUS_VALUE.

                               

                               

                              • 12. Re: "Print" button on dashboard that will open current filtered state as pdf
                                mark.welsh

                                Hi Joe Oppelt,

                                Now that I'm able to use Previous Value to create a string list for one dimension, I need to expand it to three.  In the attached copy of the workbook you uploaded I made some adjustments to the 'dummy button' sheet.  My goal is to get a string list for Container, Department, and Order Date that I can pass through as parameters.  Passing each order date doesn't seem feasible, but in my production workbook I'll only be passing 12-15 months at a time, by month, not day.  I.E. the dates in my production workbook are listed like 8/1/2015, but this represents the entire month of 8/2015 not just the first day.

                                 

                                Also, I'm having issues getting the Order Date to display yyyy-mm-dd in the string list so that I can pass it through as a URL parameter.  I don't believe that I can use a 'between' function in the URL parameter, so I would have to explicitly list each Order Date.

                                 

                                Hope this makes sense.

                                 

                                Edit: Added a Mention for visibility. 

                                • 13. Re: "Print" button on dashboard that will open current filtered state as pdf
                                  mark.welsh

                                  Still looking for a solution to my latest post. 

                                  • 14. Re: "Print" button on dashboard that will open current filtered state as pdf
                                    Joe Oppelt

                                    Mark -- Let's start with a fresh twbX.  I need to get reoriented with what's needed here.

                                    1 2 Previous Next