4 Replies Latest reply: Jul 10, 2017 1:26 PM by Ruben Marin RSS

    How many criteria can given using "And" logic in IF condition?

    Moni Shankaranarayanan

      I have following script which is not working Properly as i have used three Conditions using "AND" .It works good when i use two condition with one "AND". Is there solution to for applying three criteria in IF condition?

       

      if((Not IsNull("Customer Name Today") and Not IsNull("Customer Name Yesterday") and [Customer Name Today]=[Customer Name Yesterday]),'No Change',

      if((Not IsNull("Customer Name Today") and Not IsNull("Customer Name Yesterday") and [Customer Name Today]<>[Customer Name Yesterday]),'Change',

       

      Could any one please help me to work on the right approach towards this issue ?


      Thanks

        • Re: How many criteria can given using "And" logic in IF condition?
          Ruben Marin

          Hi Moni, there should be no problem using many "ands", what it's happening and what's the expected result?

           

          You can create a simple table to check the data and see what is happening:

          Dimensions (check in both 'supress null values'):

          - "Customer Name Today"

          - "Customer Name Yesterday"

          Expression:

          If("Customer Name Today"="Customer Name Yesterday", 1, 0)


          You can sort by expression to group them and follow the result of the conditionals.


            • Re: How many criteria can given using "And" logic in IF condition?
              Moni Shankaranarayanan

              Hi,

              This is my full formula. I need this Column should be used in the table. On using this formula it is not displaying 2nd and 3rd Condition alone.

               

              if((IsNull("Customer New Today") and IsNull("Customer Old Yesterday")), 'No Change',

              if((Not isNull("Customer New Today") and  Not IsNull("Customer Old Yesterday") and ([Customer New Today]=[Customer Old Yesterday])),'No Change',

              if((Not isNull("Customer New Today") and  Not IsNull("Customer Old Yesterday") and ([Customer New Today]<>[Customer Old Yesterday])),'Change',

              if((IsNull("Customer New" Today) and Not isNull("Customer Old Yesterday")),'Deletion',

              if((not IsNull("Customer New Today") and IsNull("Customer Old Yesterday")),'Addition'))))) as [Customer LineType]