Reputation: 800
I am new to tableau 10. I have two class variables say A and B entered in rows at the top of my worksheet. What I want is the count of A and B (in statistics we call A*B an interaction). I want the number of rows with A and B attributes.
Thanks. Mary A Marion
Upvotes: 2
Views: 44
Reputation: 127
This can be achieved with the help of Sets in Tableau or using a Filter. I will explain the procedure for both with this sample dataset.
+--------+--------+------+
| ClassA | ClassB | Name |
+--------+--------+------+
| 1 | 1 | Abc |
| 0 | 0 | Def |
| 0 | 1 | Ghi |
| 0 | 1 | Jkl |
| 0 | 1 | Mno |
| 1 | 0 | Pqr |
| 1 | 0 | Stu |
| 1 | 0 | Vwx |
| 1 | 1 | yz |
+--------+--------+------+
Set - We create a set from name the 'Name' field as shown below
We should create the set based on a condition. When ClassA = 1 AND ClassB = 1. We do that as shown below. I am naming the set with the default name 'Set 1'
Now, drag 'Set 1' and 'Number of Records' to the rows. We would get something as shown below.
This can be read as 2 member are in the set, while 7 do not satisfy the condition and are out of the set.
Filter - Add ClassA and ClassB to the filter and select the values you want to see. Below is the screenshot of the output of adding a filter
Hope this helps!
Upvotes: 2