2 Replies Latest reply on Feb 4, 2016 8:40 AM by dgp_express

    I don't see what is wrong with this calculation

    dgp_express

      Case ( IsEmpty ( Company ) ; First Name & " " & Last Name ;

             IsEmpty ( First Name ) and ( Last Name ) ; Company ;

             (Company) & ": " & NameFull )

       

      I get this result if there is no name   Company Name:

       

      What I am after is the company name without the colon if there is no first and last name

      and only see the colon if there is a name following the company name.

        • 1. Re: I don't see what is wrong with this calculation
          mikebeargie

          the function is:

          Case(

            Condition 1 ; result 1 ;

            Condition 2 ; result 2 ;

            Condition etc... ; result etc.. ;

            else return this

          )

           

          Yours is wrong where I've underlined:

          Case (

             IsEmpty ( Company ) ; First Name & " " & Last Name ;

             IsEmpty ( First Name ) and ( Last Name ) ; Company ;

             (Company) & ": " & NameFull

          )

           

          Note that you need another IsEmpty() around last name, otherwise you're just asking if last name is "true". Also, no need for the brackets around Company on the last line.

           

          Try:

          Case (

             IsEmpty ( Company ) ; First Name & " " & Last Name ;

             IsEmpty ( First Name ) and isEmpty( Last Name ) ; Company ;

             Company & ": " & NameFull

          )

          • 2. Re: I don't see what is wrong with this calculation
            dgp_express

            Thank you very much for your reply.  I am now getting the expected results.