Column the number of times the same value appears in the column

I have such a field that

Color
Pink
Blue
Pink
Blue
Pink
Pink
Pink
Pink
Pink
Blue
Blue
Pink
Pink
Pink
Blue
Pink
Blue
Pink
Blue

How to create a calculated field to count the number of times Pink appears?

The total number of blue?

+4
source share
1 answer

If you group by color and only color in the view, you can just use SUM(Number of Records). For example, put Color on the Rows shelf and SUM(Number of Records)in Text, and you get a table with a count for each color.

If you need to specify the level of detail, Tableau has LOD expressions (level of detail) that will make this easy.

{ FIXED [Color] : SUM([Number of Records]) }

, SUM() of [Number of Records] [Color], .


FYI, [Number of Records] - , Tableau . :

1

1 . SUM() , . , LOD :

{ FIXED [Color] : SUM(1) }
+3

Source: https://habr.com/ru/post/1608578/


All Articles