4 Replies Latest reply on May 9, 2013 11:10 AM by KurtSnow

    Contrain Found Set for mutliple variable

    KurtSnow

      Title

      Contrain Found Set for mutliple variable

      Post

           I need to add more than one variable in the Constrain Found Set script. I am used to another database whereby I would simply add the additional variables separated by a comma, but I cannot do that in Filemaker. Specifically, I need to constrain the data set to both the "Payment" and "Invoice" variables found in the "transactionType" field.

        • 1. Re: Contrain Found Set for mutliple variable
          philmodjunk

               Enter Find Mode []
               Set Field [Table::transactionType ; "Payment" ]
               New Record/Request
               Set Field [Table::TransactionType ; "Invoice" ]
               Constrain Found Set[]

               For more exampls of scipted finds, see: Scripted Find Examples

          • 2. Re: Contrain Found Set for mutliple variable
            KurtSnow

                 Thank you.

                 I have another question concerning this same report. I have a subsummary based on the transactionType field. So, it summarizes the transactionType "Payment" and the transactionType "Invoice." The report displays properly. Now, I would like to be able to subtract the subsummary value for "Invoices" from the subsummary value for "Payment". First, I created a getSummaryPayment and a getSummaryInvoice fields. They also display the correct amounts. However, I am not sure what to do next. The calculation "getSummaryPayment" minus "getSummaryInvoice" does not work when placed in the trailing Grand Summary, nor in the subSummary parts. Perhaps what I want to do is not possible?

            • 3. Re: Contrain Found Set for mutliple variable
              philmodjunk

                   How did you define these two new fields?

                   are they calculations with the getsummary function or something else?

                   The following should work:

                   Define a pair of calculation fields that will be blank unless the transaction is of the correct type:

                   cPaymentAmounts: If ( TransactionType = "Payment" ; amount )
                   cInvoiceAmounts: If ( TransactionType = "Invoice" ; amount )

                   Then a pair of summary fields can compute the total invoices and the total payments and then you can define yet another calculation field to subtract the two.

              • 4. Re: Contrain Found Set for mutliple variable
                KurtSnow

                     That worked. Thank you again!