简体   繁体   English

Tableau 计数值

[英]Tableau count values

I have a tableau table with data as follows我有一个数据表如下

Column1 Column2
abc      12
         234
         35
         453
bcd      52
         64
         421
cde      222
def      83
         94

now, I am looking for a third column, where I can get the count of the values within column 2 group by column 1.现在,我正在寻找第三列,我可以在其中按第 1 列获取第 2 列中的值的计数。

so basically my desired solution is :所以基本上我想要的解决方案是:

Column1 Column2 Column3
abc      12       4
         234
         35
         453
bcd      52       3
         64
         421
cde      222      1
def      83       2
         94

I am quite new to tableau, I would appreciate any assistance or advice.我对画面很陌生,我将不胜感激任何帮助或建议。 Thanks谢谢

Since you "need" to have Column2 in the table, the level of detail will take into consideration a more granular level than your calculus.由于您“需要”在表中包含 Column2,因此详细级别将考虑比您的微积分更细粒度的级别。

In order to bypass that, you may want to use a LOD function such as Fixed, in order to calculate your count despite showing a more granular level (Column2).为了绕过这一点,您可能需要使用诸如 Fixed 之类的 LOD 函数,以便在显示更细粒度的级别(Column2)的情况下计算您的计数。

To do, you may create a calculated field like this:为此,您可以创建一个计算字段,如下所示:

{ FIXED [Column1] :COUNT([Column2])}

In the end according to your needs, you can put that calculated field before or after your Column2 pill.最后,根据您的需要,您可以将该计算字段放在 Column2 药丸之前或之后。

Before:前:

在此处输入图片说明

After:后:

在此处输入图片说明

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

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