1 Reply Latest reply on May 19, 2013 9:35 AM by Ken Hunt

    How do I filter a 2 fields at once?

    Sarah Gravely



      I am trying to select all HHID (household IDs) that have purchased in particular division. My HHID is a dimension and my divisions are in measures and calculated as quantities. I want to select only HHID that have DIV009QTY > 0. I'm very new at Tableau and I'm not sure how to filter by both of HHID and division. Do I need a calculated field? Any help is appreciated, and please let me know if I need to be more specific or explain what I'm trying to do better.



        • 1. Re: How do I filter a 2 fields at once?
          Ken Hunt

          Hi Sarah,

          Yes a calculated field should do the trick. It's hard to tell exactly which approached based on your example, but I'll take a stab at it.


          Create calculated field that uses an if statement to identify the division, add any additional criteria, and if the entire calculation returns true, return the id (HHID in your case). Just right click on HHID and choose Create Calculated Field. Put in logic similar to this:


          IF (put your criteria here) THEN [HHID]


          You can then use this calculated field as needed for your application.


          Note, sometimes you need to create a couple of calculated fields - and your final calculated field references a different "helper" calculated field to return the outcome you desire.