Video | Tableau | Data prep | Data visualisation

ZN Function in Tableau

Find out why you need to know about this function and how to use it.

  • ZN() returns the expression if it isn't null, otherwise returns zero, making it ideal for handling nulls in number fields
  • Nulls left untreated can throw errors or silently skew aggregations like averages, leading to misleading results
  • Wrapping a field as ZN([Revenue]) and prefixing the calculated field name makes it clear you're handling nulls
  • Use the calculation editor's function panel to validate what ZN does before applying it
  • Replacing null with zero improves data literacy since most business users don't understand the term 'null'

Link to mock data set

The ZN function helps you deal with issues and challenges caused by having Null values as part of calculations and aggregations. In this video, I show you how it works, how to use it and a scenario highlighting why it’s important to know about this function.

  • 0:00 Intro
  • 0:22 How does ZN work in Tableau?
  • 3:33 Use cases
  • 6:34 Outro