Isnull in custom column expression

I want to create a custom column that would be true or false depending on whether a column is null or not, and not having any luck. It reproduces with sample data, too:

  • Start a new question using Sample Database, Reviews table
  • Try to add a new custom column
  • Try to specify isnull([Product ID] ) as expression

I get the error that say "Expecting expression but found function isnull returning boolean", even though my reading of Improve Custom Expression Experience · Issue #14214 · metabase/metabase · GitHub suggests that isNull should work just fine everywhere, and the hint for isNull shows exactly the usage I'm trying to do. I am using version 0.44.

Any idea what I am doing wrong?

You are probably hitting Custom Columns does not accept boolean expression result · Issue #15922 · metabase/metabase · GitHub ... There is a workaround proposed by @flamber in the thread

case(isnull([Product ID]), "true", "false") should work

Thank you! The workaround worked (and I've subscribed/liked the github issue)

1 Like