6 Replies Latest reply on Jun 8, 2017 11:23 AM by Hari Ankem

    IF THEN statement containing a WILDCARD search

    Abbie Argersinger

      I am trying to create a calculated field in Tableau that recreates case logic I have written in SQL, and I can't seem to find a LIKE statement - my SQL case is this - I know I can use IF THEN in Tableau - it's that wildcard search in a string that I am struggling with

       

       

      CASE

       

      when SUBSRPTN_ACTV_LIST_TXT LIKE ANY ('%P6690%','%101980%') then 'Chinese'


      when SUBSRPTN_ACTV_LIST_TXT LIKE ANY ('%P5724%','%P100388%','%P5739%') then 'Filipino'


      when SUBSRPTN_ACTV_LIST_TXT LIKE ANY ('%P5445%','%P100358%') then 'Vietnamese'


      when SUBSRPTN_ACTV_LIST_TXT LIKE ANY ('%P6069%','%P7020%','%P102612%', '%P103547%') then 'Korean'


      when SUBSRPTN_ACTV_LIST_TXT LIKE ANY ('%P5964%','%P7032%','%P100750%','%B5960%','%B5969%') then 'Russian'


      when SUBSRPTN_ACTV_LIST_TXT LIKE ANY ('%P6349%','%R6348%','%R6347%') then 'Brazilian'


      else 'None'


      end as DTV_international_pkg