2 Replies Latest reply: Aug 30, 2011 9:24 AM by Jonathan Love RSS

    IF + AND

    Jonathan Love

      How do I combine these two exepressions:


      = IF (Wildmatch(address_number, '9*'), 'Not In Service', 'In Service')


      = IF (Wildmatch(individual_item_number, 'PRIN*), 'Not Installed', 'Installed')


      Into IF both conditions , (Not in Service and Not Installed)  'Not Active', 'Active'  ?


      (I do not need to keep either of the original expressions, but they both work alone)


      Thanks a bunch, JL

        • Re: IF + AND
          Nagaian Krishnamoorthy

          The following script works. There may be other ways of doing this also.


          LOAD *,

                    If(WildMatch(address_number, '9*')=1, 'Not In Service', 'In Service') as [In Service],

                    If(WildMatch(individual_item_number,'PRIN*')=1,'Not Installed','Installed') as Installed,

                    If((WildMatch(address_number, '9*')=1) and (WildMatch(individual_item_number,'PRIN*')=1),'Not Active', 'Active') as Active;

          LOAD * Inline [

          address_number, individual_item_number

          1234, ABCD123

          9876, ABC2345

          2345, PRIN123

          9765, PRIN345