mercredi 24 juillet 2019

Case When/ IF Else in Tableau

Can anyone help me to write case when/if else statement.

I created a calculate field (see below). I am not good at writing codes. What I want is:

If I ONLY select complete it should show on top textbox case completed

and

If I select pending it should show case closed

and

If I select cancel then it should show cancel.

and

If I select complete and pending or complete and cancel or pending and cancel then it should show case closed.

Currently what's happening if I select complete and pending it is showing both text (Case Complete and Case Closed). I attached the picture as well.

Thank You !!!

IF [Status] = "Complete" THEN 'Case Completed'

ELSEIF 
[Status] = "Pending" THEN 'Case Closed'

ELSEIF 
[Status] = "Cancel" THEN 'Case Closed'


END

enter image description here

Aucun commentaire:

Enregistrer un commentaire