5 Replies Latest reply on Aug 26, 2017 9:49 PM by mehdi fanai

    How to parse excel rows to tableau conditionals

    mehdi fanai

      Hello Tableau gurus,

       

      I have a list of categorical numbers and their values in an excel table like this:

         

      20 = TRANS FROM ON-SITE ACUTE CARE UNIT TO ON-SITE REHABILITATION UNIT 
      21 = TRANS FROM ON-SITE REHABILITATION UNIT TO ACUTE CARE UNIT
      22 = TRANS FROM ON-SITE REHABILITATION UNIT TO CHRONIC UNIT
      23 = TRANS FROM CHRONIC UNIT TO ON-SITE REHABILITATION UNIT
      24 = TRANS FROM ON-SITE ACUTE CARE UNIT TO CHRONIC UNIT 
      25 = TRANS FROM ON-SITE CHRONIC UNIT TO ACUTE CARE UNIT 
      26 = TRANS FROM ON-SITE ACUTE CARE TO ON-SITE PSYCHIATRIC UNIT
      27 = TRANS FROM ON-SITE PSYCHIATRIC UNIT TO ACUTE CARE UNIT 
      28 = TRANS FROM ON-SITE SUB-ACUTE UNIT TO ACUTE CARE UNIT
      29 = ADMIT WITHIN 72 HOURS FROM ON-SITE AMBULATORY SURGERY UNIT WITH SURGERY 
      30 = NEWBORN (PATIENT BORN IN HOSPITAL)

      31 = TRANS FROM ON-SITE ACUTE CARE TO ON-SITE HOSPICE

      ... = ....

       

      I need to create a calculation field like this in Tableau:

       

      CASE [number] when 20 then "TRANS FROM ON-SITE ACUTE CARE UNIT TO ON-SITE REHABILITATION UNIT" when 21 then... when 22 then ...END
      

       

      So I have a relatively big excel table and I want to create a "case" or "IF" conditional phrase in Tableau and I do not want to spend hours doing so. Also I understand that this might not be the smartest thing but I was wondering how can I generate this on the fly? If it's not possible in Tableau, then is there another text editor with a GUI for easily parsing these kind of things?

       

      Thank you