简体   繁体   中英

Tableau Finding count of two classificatory varibles

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

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM