Cohen Fisher
Cohen Fisher

Reputation: 67

Tableau calculated field - classifying

Hi I am a Tableau beginner and need some help.

I have a sheet that looks like this.

ID    Type
27    A
      B
38    B
19    A
      B
28    A
      B
18    A
29    A
      B

For an ID, if the type is A and B, I want to classify it as A. So desired result is this.

ID    Type
27    A
38    B
19    A
28    A
18    A
29    A

I can’t just say ‘if type = A and B then A’ because there are some other fields involved in where I need to both to show.

I need to a calculated field that will allow me to tie this condition to the ID field specifically.

Upvotes: 0

Views: 53

Answers (1)

Keshia Rose
Keshia Rose

Reputation: 191

One way you could do this is with an LOD calculation. Something like this should do the trick:

IF {FIXED [ID] : MAX([Type] = "A")}
AND {FIXED [ID] : MAX([Type] = "B")}
THEN "A"
ELSE [Type]
END

Upvotes: 1

Related Questions