4 Replies Latest reply on Jun 19, 2018 12:10 PM by Deepak Rai

    Total by Gender

    Jay Parmar

      Hi

      I am new to Tableau and just had a workshop today. I have a text file that has attribute gender  has values of Male and Female.

      I am needing to create a measure total_Female and Total_Male

       

      How would I do that, if someone can guide me would be really helpful

        • 1. Re: Total by Gender
          Jim Dehner

          Hi

          Welcome to Tableau

          one way to do the calculation is with LOD expression

           

          { FIXED [Gender]:count([Number of Records])}

           

          you could also use 2 if statements

          if [Gender]="Male" then 1 else 0 end

           

          if [Gender]="Female" then 1 else 0 end

           

          Jim

           

          If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

          1 of 1 people found this helpful
          • 2. Re: Total by Gender
            Don Wise

            Hi Jay,

            Do you mean something like the attached (2018.1 version) and below? Hard to tell without your actual data.

             

            Screen Shot 2018-06-19 at 12.04.53 PM.png

            Drag the dimension to the marks card and then change to Count.  It is a simple Count of the Dimension:

            Screen Shot 2018-06-19 at 12.04.56 PM.png

             

            If this is correct, please mark this response as such so that others can find it useful in the future. Thx, Don

            • 3. Re: Total by Gender
              Wesley Magee

              Jay,

              I'm not entirely sure I understand what you're looking for, but it sounds like you could drag [Gender] to the the Rows shelf and then drag another copy of it to the Columns shelf. Then right click on the pill on the Columns shelf and select Measure > Count.

               

              This will give you the count of males and females.

              -Wesley

               

              If this post assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

              • 4. Re: Total by Gender
                Deepak Rai

                Total Male

                COUNT(IF Gender="Male" THEN Gender END)

                 

                Total Female

                COUNT(IF Gender="Female" THEN Gender END)

                 

                and if you need more help, pl attach some dummy data and if the above helps, then Please close Thread by marking Reply as Helpful and CORRECT

                Thanks

                Deepak

                2 of 2 people found this helpful