4 Replies Latest reply on Aug 30, 2009 12:56 AM by comment_1

    Moving calc

    aklguy

      Title

      Moving calc

      Post

      Hi guys got a dozy one for you if you can help.

      Writing a small database for a mate (in FM10)

      He wants some relationship link set up so on one record it shows the total for that record and the 4 previous to it.

      so on record 7 for example it will have 7,6,5,4,3 record info and a calc based on those

      but then on record 9 it will have 9,8,7,6,5 example

      information will be target, actual, difference

      once I have that set up he wants a average of the difference as well as the the high and low over those 5 records, in 3 fields below 

      would it be best to have a portal row? Field Repetitions? I am going with Field Reps myself but I cant make it work.

      example below: (on record 7)

      (on the left side) 

      RECORD 7

      Target $x

      Actual $y

      Difference $d 

       

      (on the right side)

      Record    Target    Actual  Difference

         7        $x         $y        $d

         6        $x         $y        $d 

         5        $x         $y        $d 

         4        $x         $y        $d

         3        $x         $y        $d 

      Total Target $TT

      Total Actual $TA

      Total Differ $TD 

      Av Diff $AD

      High Diff $HD 

      Low Diff $LD

       

      Get what I mean?? 

        • 1. Re: Moving calc
          comment_1
             See if this helps.
          • 2. Re: Moving calc
            aklguy
              

            Ok that sort of helps

            I created a new Global repeating field with 0,1,2,3,4 as the values called this Countback 

            Then to get the record numbers I used this formula Extend "( GetNthRecord ( Round ID ; Get ( RecordNumber )-Countback ) )"

            I know thats not working.

            do you think I should just create 4 new fields and do it manual rather than a global repeating field?

            • 3. Re: Moving calc
              aklguy
                

              All sorted now.

              just a few more fields 

              • 4. Re: Moving calc
                comment_1
                  

                aklguy wrote:
                do you think I should just create 4 new fields and do it manual rather than a global repeating field?

                I think that if you want to do it this way, you can get rid of the global field and make the repeating calculation field =

                 

                GetNthRecord ( Extend ( Round ID ) ; Get (RecordNumber) - Get (CalculationRepetitionNumber) + 1 )