6 Replies Latest reply on Sep 21, 2017 12:45 PM by Barbara Knowles

    Viz Alerts Filter Issue

    Barbara Knowles

      Hi.

       

      I'm trying to filter data using both VIZ_CSV() in the Email Attachment field and VIZ_IMAGE() in the Email Body field and it's not working.

       

      Everything else is working fine.  The emails run on the subscription schedule, the file name is correct, the image contains the hyperlink, but neither the image nor the csv file are filtered.

       

      Here is the formula for the Attachment: 'VIZ_CSV(TransactionSummaryMockup/TransactionSummaryExample?Email%20To='+[VizAlertsToEmail]+'|filename=Transaction Summary)'

       

      Here is the formula for the Body: 'VIZ_IMAGE(TransactionSummaryMockup/TransactionSummaryDashboard?Email%20To='+[VizAlertsToEmail]+'|vizlink)'

       

      I created parameters for the two filters because I'm linking a data source in one database with a table in a separate database and Tableau does not like that.

       

      It's donation data.  The emails are associated with allocation codes, to which donations are made.

       

      I'm pretty sure the problem is in the filter code, but I can't figure it out.

       

      Please help!  I've been staring at it all day.

       

      Thanks.

      Barbara

        • 1. Re: Viz Alerts Filter Issue
          Jonathan Drummey

          Hi Barbara,

           

          Here’s what I do to test:

           

          1) Verify that the field name(s) I’m giving for a URL parameter exist in the workbook as fields or parameters.

          2) Look at the output of a formulas in a viz and visually inspect it for issues.

          3) Test the output from #2 on Tableau Server.

               a) Login to Tableau Server as the VizAlerts user.

               b) Copy the leading part of the URL for views e.g. http://myserver.company.com/ <http://myserver.company.com/>

               c) Paste that into a text file

               d) Copy the workbook/viewname & URL parameter from #1.

               e) if necessary URL encode that value (VizAlerts naturally does this).

               f) Paste that into the text file to create a complete URL.

               g) Copy & paste the URL from step #25 into Tableau Server. If that doesn’t get you to the desired view then hopefully you can figure out what is wrong, or post it here and we can take a look.

           

          Jonathan

          • 2. Re: Viz Alerts Filter Issue
            Jonathan Drummey

            Hi Barbara,

             

            I had a chance to look at your TWBX. Without seeing the data (since it wasn’t extracted I don’t have access), I’m pretty sure what’s going on is that Tableau’s URL Parameters only work on filters for fields from the primary source and parameters. In the viz the Email To field only exists in the secondary source. So what is happening is Tableau is looking for an Email To field, not finding one in the primary source or any parameters, and ignoring that field for filtering.

             

            Here’s the workaround:

             

            1) Create a parameter and give it a unique name (i.e. not a field from the primary or secondary) like EmailToFilterParam

            2) Create calculated field in the secondary source that is  =

            3) Put the field from #2 on the Filters Shelf in your viz and filter for True.

            4) Change the content references to use the EmailToFilterParam (or whatever you name the parameter) instead of Email%20To.

            5) Publish the workbook and test.

             

            Cheers,

             

            Jonathan

            • 3. Re: Viz Alerts Filter Issue
              Barbara Knowles

              Thanks so much for your responses.

               

              Unfortunately, either I didn’t understand them or it’s just not working.

               

              I’m attaching the packaged workbook

              • 4. Re: Viz Alerts Filter Issue
                Matt Coles

                Hey Barbara, the problem is that you've got a connection to a Tableau Server data source, and we can't access your Tableau Server. You will need to ensure that data source has been extracted into your workbook before you export it to a packaged workbook and send it to us. Note that whatever data is in there will be available to everyone in the entire world if you attach it here--this forum is not secured in any way. Not a problem if it's publicly available data, but if it's anything internal to your organization, that's obviously not good. If the latter is the case, then you can email it to me if you like, and I can take a look. I'm at:

                • 5. Re: Viz Alerts Filter Issue
                  Matt Coles

                  (sorry, I just hit "assumed answered" on your question and can't figure out how to undo it!)

                   

                  So, I wasn't aware of the nuance Jonathan pointed out about using URL parameters to filter on a secondary data source. I looked at your workbook, and while I can't test this on my own server, here's what I think you need to do to get this working as you want:

                   

                  First, edit your VizAlertsToEmail parameter and switch it to a String type:

                   

                   

                  Allow all values, and give it some current value that matches what's currently showing in your Transaction Summary Example sheet, just so we can see something there later.

                   

                  2017-09-21_11-20-38.png

                  Click OK.

                   

                   

                   

                  Now, create a calculated field on your primary data source, let's call it "Email Filter Is True". This simply compares the VizAlertsToEmail parameter value to that of the Email To value in this sheet:

                   

                  Add that newly created field to your Filters shelf, and filter it to True:

                   

                  2017-09-21_11-22-28.png

                   

                   

                  Finally, expose your parameter on the sheet (I'm actually only 60% sure this is necessary ):

                   

                   

                   

                  Everything else looks like it should work, after you do these things. Let me know if it does!

                  • 6. Re: Viz Alerts Filter Issue
                    Barbara Knowles

                    Thank you so much!  That was the solution!