3 Replies Latest reply on Sep 17, 2018 5:35 PM by Shinichiro Murakami

    How to replace integer nulls from a Measure's Calc Field with a string

    Manuel Ramos

      Hello Tableau Community!

       

      I need to replace integer nulls from a Measure's Calc Field in my view with a string.

       

      For example I want The Number of Days to Close Calc Field in the print screen below to show 'Case Open' when a null is found in the Calc Filed below

      •      In other words, when there is a null how do I change that null to say 'Case Open'?
      •      DATEDIFF('day',[Created Date GMT],[CLOSEDDATE_GMT],'Sunday')

       

      My Calc Field started off in the Measure's Shelf, until I changed its data type to a string and is now in the.

       

      Calc Field when in Measure's Shelf  (*Before my attempt to change Nulls to a string)

      DATEDIFF('day',[Created Date GMT],[CLOSEDDATE_GMT],'Sunday')

       

      Calc Field when in Dimension' Shelf  (*After my attempt to change Nulls to a string)

       

      IF ISNULL(DATEDIFF('day',[Created Date GMT],[CLOSEDDATE_GMT],'Sunday'))

      THEN 'Open' ELSE STR(DATEDIFF('day',[Created Date GMT],[CLOSEDDATE_GMT],'Sunday'))

      END

       

      I reviewed Can I replace "Null Values" with a string ? and other documents but could not find my answer.

       

       

      Thank you for your help.

       

      -Manuel