The reason you get NULLs is because your calculation does not include an ELSE, so NULL is the fallback if no other conditions are met. Change your calculation to something like this (note that you'll have to normalize the date to a string to ensure the IF block returns the same data type):
IF [Show Year of Application?] = "Yes"
THEN STR([App Date])
Jamieson - when I do this, my calculated field in the COLUMN shelf turns red and says that "the calculation applies a date function to a non-date field".
I get that I need to define a state for the "No" case. Is there another way?
1 of 2 people found this helpful
Not that I can think of. The value will contain either a date (in which case NULL is the only option to represent a non-value), or a string. If you are doing a calculation in the COLUMN shelf, consider moving it into the calculated field I provided, so that you can convert the whole thing to a string without Tableau complaining.
(Hint: attaching a Tableau packaged workbook would allow us to see the construction of your view and offer more detailed, and tested, feedback.)