Nithya
Nithya

Reputation: 33

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.

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

Upvotes: 1

Views: 204

Answers (1)

Fabio Fantoni
Fabio Fantoni

Reputation: 3167

Since you "need" to have Column2 in the table, the level of detail will take into consideration a more granular level than your calculus.

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).

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.

Before:

enter image description here

After:

enter image description here

Upvotes: 4

Related Questions