Here's one that really twists my head around.
I frequently need to assign a placeholder value to a field when the Tableau interprets the data value as NULL. In most cases it's assigning a zero to a null value.
Using a calculated field as a proxy for the real data field allows me to do this, and all I need is a way to assign the value zero (0) to the calculated field when the data value is null.
The logic of this is:
to the calculated field:
if the data field is null assign zero
else assign the data field's value
The Tableau IFNULL()
function does this, and in exactly the way that it should.
Here's the Tableau calculated field dialog showing IFNULL()
(edited for space):
Spot the problem?
The description of the function is the accurate description of the function's behavior. When the data field's value is NOT null, its value is used for the calculated field, otherwise the value of expr2
provides the value. The function's description and behavior match each other, and are exactly what we need.
But the function's name is wrong.
It should be IFNOTNULL
—NOT—
IFNULL
This misnaming is at least confusing, and has the potential to lead people to making poor or outright wrong decisions when they rely on the results of employing it based on the semantics of its name.
Oddly, the logically inverted naming makes it harder for experienced programmers to find the right function to use than for inexperience people.