4 Replies Latest reply on Jan 28, 2014 7:43 PM by philmodjunk

    Perform Find via Calculation

    Rman

      Title

      Perform Find via Calculation

      Post

           Hello!

           I'm looking for help integrating a calculation into a Find script.

           I'm currently using this calculation in another script to Sort Records. But, what I'd like to do is use this calculation to Find and show only the records that meet this criteria. 

           This calculation is assigned to a field called Partial_Orders.  //An order of items that has only been partial fulfilled.

           (Parts Turned In  <   Parts Ordered  and  Number of Parts Due  < Parts Ordered) 

           I've duplicated and tried modifying one of my other working Find scripts, but It's not functioning the way I thought it would. I've modified the script (see attached image) to the best of my current Filemaker abilities using "Inset Calculated Result" and a few other versions If Statements, but I'm now repeating things I've already tried. So, technically, I'm now insane.

           Any pointers of help would be greatly appreciated.

           Thank you!

           Ryan

      Screen_Shot_2014-01-28_at_12.31.30_PM.png

        • 1. Re: Perform Find via Calculation
          Rman

               An additional shot of the current Sort using the Calculation above.

                

               Ryan

          • 2. Re: Perform Find via Calculation
            philmodjunk

                 It looks from here like you can perform a find for what you need by specifying > 0 in the PartsDue field.

            • 3. Re: Perform Find via Calculation
              Rman

                   Hey Phil!

                   Tank you!

                   Your suggestion led to the idea of making a field called "Partial Order ~ Full" with the following calculation:

                   If ( Parts Ordered  >  Parts Turned In and Number of Parts Due  < Parts Ordered ; "Partial Run" )

                    

                   Then, in my Find script I put:

                    

                   Enter Find Mode[]

                   Set Field [Stock Transaction::Partial Order ~ Full ; "Partial Run"] 

                   Perform Find[]

                    

                   This worked great. Basically, I took the calculation out for the find script and just made it into its own global calculation field that i could search by normal means.

                   I'm not using the (Partial Order ~ Full) field in a layout, it's simply there in my Stock Transactions Table as a place to search for what I want. In this case, I wanted to search for anything that equaled a "Partial Run" or (according the If statement calculation) was True. I set the calculation filed to return the result as (Text). I Then used the the text "Partial Run" in place of a 1 or 0 in the If statement. I would have used a 1 (True) if I had set the calculated result to be a number.

                   It's not as elegant as I would like, but it gets the job done for now.

                   Thank you again.

                    

              • 4. Re: Perform Find via Calculation
                philmodjunk

                     But I see no need for the calculation field when you, or a script can use the > 0 Criteria in the parts Due field.