4 Replies Latest reply on Oct 29, 2018 7:58 AM by lu.gan.2

    Chart

    lu.gan.2

      My gender ratio here is 1:2, hence I want to know how could I make a graph like below:

      Please help me out! Thank you guys!!!!

       

      When choose Male:

       

      When choose Female:

        • 1. Re: Chart
          Ken Flerlage

          This should be doable, but how will depend on your data. Can you share a sample?

          • 2. Re: Chart
            lu.gan.2

            Hi Ken,

             

            We only have 3 people,  1 is woman and 2 men. So I just want to depict a info-graph. If you can help me out I would appreciate!

            • 3. Re: Chart
              Ken Flerlage

              Okay, I'll assume your data looks something like this:

                

              Person IDGender
              1Male
              2Male
              3Female

               

              Connect to the data in Tableau. Make sure Person ID is a dimension, then drag it to the detail card. Next create a parameter, which I'll call Select Gender with two options: Male & Female. Then create a calculated field:

               

              Color

              // Specify the color based on selected gender.

              IF [Gender]=[Select Gender] THEN

                  "Blue"

              ELSE

                  "Black"

              END

               

              Drag Color to the color card and make sure the pill is above the Person ID pill. Then set the Color pill to sort alphabetically descending. This will make sure that blue is always the first color. Finally, specify your colors for each of the two options.

               

              Gender.gif

               

              See attached.

              1 of 1 people found this helpful
              • 4. Re: Chart
                lu.gan.2

                aaaaa.... Thank you so much!