3 Replies Latest reply on Feb 24, 2010 8:56 AM by ninja

    Using different formula's



      Using different formula's


      I have a formula setup for all my records and would like to know if its possible to apply a different formula to specific records.

      I am just using a single database and would like some records to one formula and other records a different formula.

      (If this makes sense)




        • 1. Re: Using different formula's

          Howdy jackdash,


          On the face of it, it looks like you need an "If" or "Case" statement.


          What about the record would make you want to choose one formula or another?  A date range? A number value? Some other marking field?


          Your formula would thus turn into the form of:


          If (criteria met for using formula1 ; "Formula1" ; "Formula2" )


          We can help with the formula, but you'll have to give more info...

          • 2. Re: Using different formula's

            A number value.


            Its a cookery recipe database with 4 columns in each record

            Column 1 holds  the ingredient name

            In column 2 the amounts are entered

            Column 3 is setup to total  all the values in column 2 and  a percentage is calculated from that data

            For column 4 there is a box  to enter a multiplier to increase the quantities from column 3 for different size batches.

            For some records I want to bypass column 3 and multiply column 2, the result to go into column 4.


            If you can decipher that lot.







            • 3. Re: Using different formula's



              OK, so you have a field called "Multiple" that either has a value or doesn't.

              One easy way to do this would be to autoenter a "1" into this field and multiply everything.


              The way you are asking about would look like:

              Field3 = If (Table::Multiple = "" ; { your Sum of field 2 here} ; "")

              Field4 = If (Table::Multiple = "" ; "" ; {your sum of field 2 here} * Table::Multiple )

              This checks for a value in the "multiple" field and calculates or not as you see fit.


              yet another way to do this is to bypass the fourth column and simply have:

              Field3 = If (Table::Multiple = "" ; { your Sum of field 2 here} ; {your sum of field 2 here} * Table::Multiple )

              ...but this is very similar to just autoentering a "1" into your 'multiple' field.


              Note: You can also use IsEmpty(Table::Multiple) in place of Table::Multiple = "" if it is more intuitive for you.


              Happy baking!  Let us know how this works out for you.