2 Replies Latest reply on Jul 26, 2017 12:10 PM by Garima Vohra

    If else, elseif

    Garima Vohra

      Hello,

       

      My question is regarding the filtering logic of a column in my data. I have a column called "Tags", each item in the data could have multiple tags separated by a comma.  The Problem is there is a number of the department that reviews each item. For example:

       

      S.NoNameDepartment
      Tags
      1ItemAMarketing"Marketing Review Pending";Accessories;June2017
      2ItemBSales, Marketing"Sales Review Pending";Marketing Review Pending";Lifecycle
      3ItemCSales, Accounting"Accounts Review Pending"; Sales Review Pending"4
      4ItemDManagement, Marketing"Marketing Review Pending"; "Management Review Pending";R4.0; Examined

       

      Now, from the above table, I only want to those items to be selected for which the "Name" column has only "Marketing Review Pending" tag on it and 'no other pending' tag like sales or accounts. I came up with the following logic -

      IF CONTAINS([Tags],"Sales Review Pending") THEN "FALSE"

      ELSEIF CONTAINS([Tags],"Account Review Pending")THEN "FALSE"

      ELSE "TRUE"

      END

       

      the question is - I am still skeptical of the results I am getting. Since my dataset is large I can't go back and verify the numbers. It would take a lot of time. Do you think I am going in the right direction?? If not, please help me through

       

       

      Thank you so much in advance!!!

        • 1. Re: If else, elseif
          Amit Narkar

          Hi Garima

           

          I could get desired values with below logic

          Check:

          CONTAINS([Department],"Marketing") AND NOT (CONTAINS([Tags],"Sales")

          OR CONTAINS([Tags],"Accounts") OR CONTAINS([Tags],"Management"))

           

           

          I worked with an assumption i.e. Any Item would have Tags only related to corresponding departments.

          so I filtered out all records with Department as marketing and confirmed that for those items Tags do not contain other Departmental reviews.

          1 of 1 people found this helpful
          • 2. Re: If else, elseif
            Garima Vohra

            Thank you Amit, I got it