6 Replies Latest reply on Sep 18, 2018 9:24 PM by zen lim

    IF statement with And condition not working.

    zen lim

      Hi All,

       

      I'm testing If And condition with a calculated field but couldn't get it to work. I have link my file below.

       

      So for each customer(customer ID) I want to determined if they have purchased during year 2011 and 2012, if its true return a 1.

       

      My calculated field goes like this:

      IF YEAR([Order Date]) = 2011 AND  YEAR([Order Date]) = 2012 THEN 1

      end

       

      As you can see for Customer ID 6 he have purchased both on 2011 and 2012 but the calculated field above is reflecting 0 instead of 1.

       

      Screen Shot 2018-09-18 at 8.35.52 PM.png