1 Reply Latest reply on Nov 18, 2016 9:36 AM by Sarah Ebreo

    Display a warning/note based on variable selected

    Rob Thomson

      Hi all,

       

      I am quite new to Tableau but loving the amazing functionality of the platform!

       

      My problem: I would like to display a text warning (in a text box or something) when a particular variable is displayed on a scatterplot.

       

      My situation: I have a dashboard that contains a worksheet, displaying a scatterplot. The Y-axis (a country-level variable) never changes, but users can select which variable to show on the X-axis, from a dropdown box, using a parameter ("Antecedent" in the image below).

       

      tab1.png

       

      For some of these "Antecedent" variable options, I would like for a message to appear in the top right of the scatterplot area, which says something like "NOTE: Latin America doesn't fit the pattern. De-select the Latin America region and see what happens."

       

      I am guessing I need to make a new calculated field for this? The variable selector currently uses this calculated field:

       

      CASE [Parameters].[Antecedent]

      WHEN "threat" THEN [THREAT]

      WHEN "threat_g" THEN [THREAT_G]

      WHEN "disease" THEN [DISEASE]

      END

       

      In order to print a warning on the scatterplot, I'd like to be able to use some sort of logic such as:

       

      WHEN "threat" THEN echo("NOTE: Latin America doesn't fit the pattern. De-select the Latin America region and see what happens.")

      WHEN "threat_g" THEN do nothing

      WHEN "disease" THEN echo("NOTE: Latin America doesn't fit the pattern. De-select the Latin America region and see what happens.")

       

      Can anyone point me to somewhere explaining how I might do this?

       

      Many thanks!

        • 1. Re: Display a warning/note based on variable selected
          Sarah Ebreo

          Hi Rob,

           

          I created a sample workbook to show how to display a warning when certain values in a quick filter and parameter are selected. Instructions are included below and on Sheet 2 and Dashboard 1 in the attached workbook. Let me know if this helps!

           

          Sarah

           

           

          1. Create Display Warning Calculated Field:

              IF Region="International" THEN

              CASE [Parameter]

              WHEN "No Warning" THEN "filterout"

              WHEN "Show Warning" THEN "Warning message text"

              END

              ELSE "filterout"

              END

          2. On a new worksheet, place Display Warning on the Filters shelf and deselect "filterout"

          3. Place Display Warning on Text and format the view as needed.

          4. Place the new worksheet on the dashboard.

           

          If the Parameter is set to "Show Warning" and "International" is selected in the Region filter then the warning message will display.