How to Deal with Nulls in Tableau (IFNULL, ISNULL, ZN)

Поділитися
Вставка
  • Опубліковано 24 лип 2024
  • Dealing with nulls in Tableau calculations requires a bit of specialized product knowledge. For instance you can’t write IF [Dimension] = NULL THEN “X” END. If you want to reference a null value, you need to use ISNULL. If you want to replace a null value with another value, you can use IFNULL. If you want to replace all nulls with zero, you can use ZN. This videos shows you how these functions work and which use cases they are most helpful for.
    -------
    Example workbook here: public.tableau.com/app/profil...
    ------
    Thanks for checking out this video! To learn more, check out our upcoming classes, webinars and office hours here: www.eventbrite.com/o/onenumbe...
    ------

КОМЕНТАРІ • 20

  • @MochaPlayer1
    @MochaPlayer1 Рік тому +1

    This was very helpful. Thank you.

    • @onenumbertableau
      @onenumbertableau  Рік тому +1

      I'm so glad it was helpful. Thanks for the support and encouragement!

  • @Nick-xu2hh
    @Nick-xu2hh 2 роки тому +1

    I’m having a problem that likely has to do with the very last thing you talked about. Good stuff man.

  • @ajitsathe3764
    @ajitsathe3764 2 роки тому +1

    Very much helpful

  • @bairavi07
    @bairavi07 Рік тому +1

    Thank you. That’s helpful. Can you use if Null with string data

    • @onenumbertableau
      @onenumbertableau  Рік тому

      Thank you! Yes, IFNULL() should work with string data too.

  • @onenumbertableau
    @onenumbertableau  Рік тому

    Need help with your nulls in Tableau? Schedule an hour with Eric here: www.eventbrite.com/e/tableau-office-hours-with-eric-parker-tickets-42691995909
    Ready to master Tableau? Check out our lineup of upcoming classes! www.eventbrite.com/o/onenumber-15678294163

  • @shoppersdream
    @shoppersdream 6 місяців тому +1

    Can you please upload the Data you are working with? If we don't practice when you are explaining to us then it does not benefit us. Thanks

    • @onenumbertableau
      @onenumbertableau  6 місяців тому

      Good call, I must have missed this one! Here is the workbook: public.tableau.com/app/profile/eric.parker/viz/IFNULLISNULLZN-DealingwithNulls/NullFunctionTitle

  • @junaidahmed6486
    @junaidahmed6486 5 місяців тому

    May i know How to handle null in a date column field ?

    • @onenumbertableau
      @onenumbertableau  5 місяців тому

      It depends what you want to replace the Null with. For example, if you're trying to calculate tenure of an employee at a company you might calculate the different between a Hire Date and a Termination Date. But if the Termination Date is null for active employees, for the sake of the DATEDIFF calculation you could do something like this IFNULL([Termination Date],TODAY())

  • @MrLukkil
    @MrLukkil 2 роки тому +1

    Replacing NULL for numbers in percentage format? Doesn't seem to work for me.

    • @onenumbertableau
      @onenumbertableau  2 роки тому

      Hi! Try using decimals instead of whole numbers. So if you want 10% it would be something like this, IFNULL([Measure],.1)

    • @MrLukkil
      @MrLukkil 2 роки тому

      @@onenumbertableau sorry I confused you with how I wrote that!
      I have some measures in percentage format which I need to change the null values with "N/A". It works for measures in number format but not percentage format for some reason.

    • @onenumbertableau
      @onenumbertableau  2 роки тому +1

      @@MrLukkil Interesting. The only way I could think to change null values to N/A would actually be to change the output to string (using the STR function). Otherwise, Tableau won't want to allow a text output for a numeric field. I've also seen folks do creative things with the number formatting options which is potentially a route you could explore: onenumber.biz/blog-1/2021/11/28/format-zeroes-as-blanks-or-dashes-in-tableau

    • @MrLukkil
      @MrLukkil 2 роки тому

      @@onenumbertableau Thanks! Appreciate the swift reply. I'll take a look!

  • @im4485
    @im4485 Місяць тому

    Tableau is complicated for no reason

    • @onenumbertableau
      @onenumbertableau  Місяць тому

      There are definitely situations where I agree! What about nulls makes you feel that way?