1 Reply Latest reply on Jan 22, 2014 7:03 AM by kettan

    I am trying to use" if" and "contain function"

    Ron Silletti

      Capture.JPG.jpg

       

      I need to create code that mimics the filter criteria above either using what i started below or from scratch. In essence, I want to be able to count all records from the file that satisfy the above criteria so I can compare that record count to the entire record count in the file

       

      Here is what I have so far that I think is correct:

      IF(CONTAINS([Program Event Name],"SCP")) OR

      (CONTAINS([Program Event Name],"P360"))  OR

      (CONTAINS([Campaign Description],"SCP")) OR

      (CONTAINS([Campaign Description],"P360")) OR

       

      :::MISSING CODE:::

      1) need this part tied as an OR statement to the code above (partner lead status not equal to blank)

      2) Theu need to capture 'Channel partner does not contain P360 or Test' ---- cannot figure out a way to do a not contain function in tableau

       

      THEN 1

      ELSE 0

      END

       

      Any ideas?

      The code should think:

      (1 or 2 or 3) and 4 need to be satisfied to create a count of 1

        • 1. Re: I am trying to use" if" and "contain function"
          kettan

          Writing NOT before CONTAINS should work.

           

          IF (
              CONTAINS([Program Event Name],"SCP") OR 
              CONTAINS([Program Event Name],"P360") OR 
              CONTAINS([Campaign Description],"SCP") OR 
              CONTAINS([Campaign Description],"P360")
              ) 
             AND NOT CONTAINS([Channel Partner],"P360")
             AND NOT CONTAINS([Channel Partner],"Test")
          THEN 1
          ELSE 0
          END