2 Replies Latest reply: Oct 19, 2012 12:42 PM by Celambarasan Adhimulam RSS

    Null Value recognition in syntax Expression

      I’ve got two products that are sold across many retailers. Each retailer assigns product preference code.

       

      I’m comparing preference code for each product by retailer, by creating FLAG column using Expression with a simple P, N, E  (P = Preferred, N = Not Preferred,

      E = Equal status). I’m using IF statement similar to this:

       

      = IF ( PROD_A  = ‘P’ AND PROD_B = ‘P’, ‘ E’,         /* if PROD_A & PROD_B = ‘P’ status = ‘E’*/

         IF  (PROD_A = ‘N’ AND PROD_B = ‘P’, ‘N’,

         IF (PROD_A  = NULL() AND PROD_B = ‘P’, ‘N’,’P’)))

       

       

      My problem is with a null value recognition when there is no P,N,E assigned to PROD_A or PROD_B.

      I tried using null expression for PROD_A, however based on the above syntax I get P for PROD_A, while it should be flagged as N.