WHEN 'Service A' THEN 1
WHEN 'Service B' THEN 2
WHEN 'Service C' THEN 3
ELSE 0 END
IFNULL([Service], 'Service D')
Thanks for the reply @Shawn.
This would have worked, but there are now are few new issues that I need to explain. First off, I don't want to have a case where I am assigning values, I need it to count how many values there are (number of records). I am going to attach a sample workbook to explain this better.
So In the attached workbook, is shows the number of records for Service A, B and C. What I need is to add Service D, E, and F to the members of the [service type] (in additional to A,B,C) that shows they D,E,F have a 0 since they were not a member, all while in Tableau. The reason behind this is as our records move, sometimes you will not see a service as it has no count but we want to see it in our table/visualizations in Tableau.
Then I could use this calculated field in the Rows column and would result in this:
Service Count of Service
Service A 1
Service B 2
Service C 3
Service D 0
Service E 0
Service F 0
So with that being said, I need to build a calculated field that checks that:
if [Service type] does not contain "Service A" return "Service A" but if it does return [Service Type] and the same goes for the other 5 services (B-E). I can't use ifnull in your suggestion due to needing to validate more than adding one addition service type.
I have tried:
If CONTAINS([Service type],"Service A")= FALSE THEN "SERVICE A"
ELSEIF CONTAINS([Service type],"Service B")= FALSE THEN "SERVICE B"
ELSE [Service type}
Unfortunately, when I add the other services in this calculated its all tied to the first line of "service A" being False.
Add memeber to Field.twbx 11.3 KB