5 Replies Latest reply on Nov 5, 2009 1:56 AM by raybaudi

    Using the case function

    Infoexcel

      Title

      Using the case function

      Post

      Hi, I am using the case function in a field and want the data from another field (as this can be variable) to be part of the result...Is this possible?

       

      I have tried the following:

       

      I.e. Case ( x= "y" ; "text & <<other field data>>"; x ≠ "y" ; "")

       

      But the result simply brings back "text & <<other field data>>"

       

      Thanks in advance...

        • 1. Re: Using the case function
          philmodjunk
            

          Don't use << >> to enclose your field name.

           

          With the cursor to the right of the &, Locate the field you want in the field list in the top section of the Specify Calculation dialog. (You may have to find it in a different table occurrence by selecting it from the table drop down.) Double click the field name in this list and filemaker will automatically insert it into your case expression at the location of your cursor.

          • 2. Re: Using the case function
            raybaudi
              

            ... also you do not need to specifya null result so your:

             

            Case ( x= "y" ; "text & <<other field data>>"; x ≠ "y" ; "")

             

            becomes:

             

            Case(

            x= "y" ; "text" & OtherFieldName

            )

            • 3. Re: Using the case function
              philmodjunk
                

              That's a user preference.

               

              I prefer to make all results explicit. I've been burned by implicit results in the past.

              • 4. Re: Using the case function
                Infoexcel
                  

                Thanks guys, but still I've still got a problem. I have removed the <<>> from the field name so the case function now reads:

                 

                Case ( x= "y" ; "some text &fieldname";x≠ "y" ; "")

                 

                But when I enter browse mode for when x=y, it shows: "some text &fieldname", rather than the actual data contained in that field. I have removed the "&" from the case function and this brings back the same result, just without the "&". 

                 

                Does it matter that the field I am entering and that I want to display contains a number? I have tried subsitituting this number field for a text field, but again the actual field name is shown again, rather than the data contained therein...

                 

                Thanks in advance...

                • 5. Re: Using the case function
                  raybaudi
                    

                  Infoexcel wrote:

                   

                  Case ( x= "y" ; "some text" & fieldname ; x≠ "y" ; "")


                  wrong position of the closing quotes.