1 Reply Latest reply on Jul 15, 2013 12:22 PM by Kris Erickson

    Way to create a graph using two drop down menus?

    Sam Frieedman

      I am wondring if there was a way such that after selecting two different items from drop down menus, a graph with the information requested is displayed.

      Example:

      I have four measures; Coffee Gross sales, Coffee Net profit, Tea Gross sales, Tea net profit. I want to be able to select any two of these and have a graph be displayed.

      The hard part: It has to be able for use on a website.

      Thank you for your time to help me with this question.

        • 1. Re: Way to create a graph using two drop down menus?
          Kris Erickson

          Sam,

           

          Yes this is possible.  You can use a parameter to swap different fields and show the chart with different dimensions or measures.  This will give a read-only viewer a way to explore different dimensions.

           

          This training shows exactly how to do that:

          Parameters | Tableau Software

          Companion Solutions

           

          Download the training solutions workbook and go to the last example.

           

          The basics consist of using a calculated field with a case statement based on a parameter:

          CASE [Choose Measure]  --the parameter

          WHEN "Coffee Gross"

          THEN [Coffee Gross Sales]

          WHEN "Coffee Profit"

          THEN [Coffee Net Profit]

          WHEN "Tea Gross"

          THEN [Tea Gross Sales]

          WHEN "Tea Profit"

          THEN [Tea Net Profit]

          END