简体   繁体   English

Tableau 查找两个分类变量的计数

[英]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.我是 tableau 10 的新手。我有两个类变量说 A 和 B 在我的工作表顶部的行中输入。 What I want is the count of A and B (in statistics we call A*B an interaction).我想要的是 A 和 B 的计数(在统计中,我们称 A*B 为交互作用)。 I want the number of rows with A and B attributes.我想要具有 A 和 B 属性的行数。

Thanks.谢谢。 Mary A Marion玛丽·马里昂

This can be achieved with the help of Sets in Tableau or using a Filter.这可以借助 Tableau 中的Sets或使用过滤器来实现。 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.当 ClassA = 1 AND ClassB = 1 时。我们按如下所示进行。 I am naming the set with the default name 'Set 1'我用默认名称“Set 1”命名集合

在此处输入图片说明

Now, drag 'Set 1' and 'Number of Records' to the rows.现在,将“Set 1”和“Number of Records”拖到行中。 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.这可以理解为 2 个成员在集合中,而 7 个不满足条件并且不在集合中。

Filter - Add ClassA and ClassB to the filter and select the values you want to see.过滤器- 将 ClassA 和 ClassB 添加到过滤器并选择要查看的值。 Below is the screenshot of the output of adding a filter下面是添加过滤器的输出截图

在此处输入图片说明

Hope this helps!希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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