4 Replies Latest reply on Aug 1, 2013 9:58 AM by Matt Lutton

    Can you specify Null values in IF/THEN/ELSE/END?

    Ashley Lambert-Maberly

      Hi,

       

      I'm creating a calculated field where I want to group all my program types into either Major or Minor.  Some program types are blank and should be considered a Major, but I'm getting a grouping of Major, Minor, and Null.  My syntax is below.

       

      If ([Department1] = [Select Department] and [primprg1] <> "MIN")

      or ([Department2] = [Select Department] and [primprg2] <> "MIN")

      or ([Department3] = [Select Department] and [secnprg1] <> "MIN")

      or ([Department4] = [Select Department] and [secnprg2] <> "MIN")

       

      THEN "Major"

       

      ELSEIF ([Department1] = [Select Department] and [primprg1] = "MIN")

      or ([Department2] = [Select Department] and [primprg2] = "MIN")

      or ([Department3] = [Select Department] and [secnprg1] = "MIN")

      or ([Department4] = [Select Department] and [secnprg2] = "MIN")

       

      THEN "Minor"

       

      END

       

      Am assuming I need to write something like: If Department1 = [Select Department] and (primprg1 <> "MIN"

      or primprg1 = "NULL")

       

      ... but how do I express the thought primprg = "Null"?  in Tableau language ... in SPSS it's = ""   but that doesn't work for me here.

       

      Any help greatly appreciated,


      Ash