4 Replies Latest reply on Mar 31, 2014 6:50 AM by evanscl

    Use of CASE function with LIST function

    evanscl

      Title

      Use of CASE function with LIST function

      Post

           I am trying to use the LIST function to list items in 5 different field, but using an embedded CASE function. However, the result I get is a "?" (question mark). How can I revise the calculation to list the results of the CASE function?

      Pt_Treatment_General =
            
      List ( 
      Case (
      Pt_Treatment_Antibiotic_YesNoUnknown = "Yes" ; "Antibiotic";  
      Pt_Treatment_NSAID_YesNoUnknown = "Yes" ; "NSAID"; 
      Pt_Treatment_SedationAnxiety_YesNoUnknown= "Yes" ; "Sedation/Anxiety Relief"; 
      Pt_Treatment_Steroid_YesNoUnknown = "Yes" ; "Steroid"; 
      Pt_Treatment_SupportiveCare_YesNoUnknown = "Yes" ; "Supportive Care")
      )

        • 1. Re: Use of CASE function with LIST function
          philmodjunk

               Your case function will return either nothing or a single value. That's not much of a list. Notice what you get when you remove the list function and just keep the case function.

          • 2. Re: Use of CASE function with LIST function
            evanscl

                 I corrected the calculation syntax to read:

            List (
            Case (
            Pt_Treatment_Antibiotic_YesNoUnknown = "Yes" ; "Antibiotic");
            Case (  
            Pt_Treatment_NSAID_YesNoUnknown = "Yes" ; "NSAID"); 
            Case (
            Pt_Treatment_SedationAnxiety_YesNoUnknown= "Yes" ; "Sedation/Anxiety Relief");
            Case ( 
            Pt_Treatment_Steroid_YesNoUnknown = "Yes" ; "Steroid"); 
            Case (
            Pt_Treatment_SupportiveCare_YesNoUnknown = "Yes" ; "Supportive Care")
            )
                  
                 Is there a way to list these values separated by commas instead of a carriage return?
            • 3. Re: Use of CASE function with LIST function
              philmodjunk

                   Substitute ( your calc goes here ; ¶ ; ", " )

              • 4. Re: Use of CASE function with LIST function
                evanscl

                     Thank you. The following script worked:

                Substitute (
                List (
                Case (
                Pt_Treatment_Antibiotic_YesNoUnknown = "Yes" ; "Antibiotic") ;
                Case (  
                Pt_Treatment_NSAID_YesNoUnknown = "Yes" ; "NSAID") ; 
                Case (
                Pt_Treatment_SedationAnxiety_YesNoUnknown= "Yes" ; "Sedation/Anxiety Relief") ;
                Case ( 
                Pt_Treatment_Steroid_YesNoUnknown = "Yes" ; "Steroid") ; 
                Case (
                Pt_Treatment_SupportiveCare_YesNoUnknown = "Yes" ; "Supportive Care")) ;
                "¶"; ", ")