mercredi 22 juin 2016

Tableau - Calculated Field : repeat count when multiple conditions are met

This is a column

Status
A B C
A B
A B C
A B
A 
A
A
A B
A B C

I have a column named Status where each row contains all the different status taken by a person.

I'm trying to create a calculated field which should give the following table

Status Count
A      9
B      6
C      3

Here's an attempt

IIF(CONTAINS([Status],"A"),"A",
    IIF(CONTAINS([Status],"B"),"B",
        IIF(CONTAINS([Status],"C"),"C","")))

The returned result using the calculated field above is however:

Status Count
A      9
B      0
C      0

Can someone help me out with this? I truly believe the solution would be simple.

Thanks!

Aucun commentaire:

Enregistrer un commentaire