1 Reply Latest reply: Jun 12, 2014 7:40 AM by Iyyappan v RSS

    Nested If Statement

    AVIRAL NAG

      Hi Community

          

      IDDivisionDepartmentCentreGroup
      1111AAAZZZAZZA
      2222YYYBY
      3333BBBXXX
      4444WWWCW

       

       

      Condition to be used if Group is Blank:

       

      if((len(trim(Group))<1 and len(trim(Centre))<1 and len(trim(Division))<1),Department,

      if((len(trim(Group))<1 and len(trim(Centre))<1 and len(Division)>1),Division,

      if((len(trim(Group))<1 and len(Centre)>1 and len(trim(Division))<1),Centre,Group)))   AS Group

       

       

      Is the Above Expression used is Correct.............................????

       

       

      Above Expression Description:

       

      if(Group is Blank  and Centre is Blank and Division is Blank, Department,

      if(Group is Blank and Centre is Blank and Division is NOT Blank, Division,

      if(Group is Blank and Centre is NOT Blank and Division is Blank, Centre, Group)))

       

       

      How to achieve this.

       

       

      Regards

      Aviral Nag

        • Re: Nested If Statement
          Iyyappan v

          Hi,

           

          Try like this

          // Load the Excel files

          Table1:

          Load

          ID,

          Division,

          Department,

            Centre,

          Group

          From Table1:

           

          Table2:

          Load

          ID,

          Division,

          Department,

            Centre,

          if((IsNull(Group) <> 0 And IsNull(Centre) <> 0 and IsNull(Division) <> 0),Department,

            if((IsNull(Group) <> 0 And IsNull(Centre) <> 0 and IsNull(Division) = 0), Division,

             if((IsNull(Group) <> 0 And IsNull(Centre) = 0 and IsNull(Division) = 0), Centre))) AS Group

          Resident Table1;

           

          Hope its help

           

          Regards,

          Iyyappan.