3 Replies Latest reply on Sep 20, 2010 9:31 AM by philmodjunk

    Calculation

    Tmmy

      Title

      Calculation

      Post

      Hi, my problem is produce the difference between the last numeric value with the second last value in the same table. But the first value is as it is. I suppose some sorting is a good start but I don't know how. In the table is also an ID and date.

      Thanks in advance

        • 1. Re: Calculation
          sunmoonstar.13

          Try this:

          Create a Calculation field with the following calculation (with the result of the calculation set to Number):

           

          Case ( Get ( RecordNumber ) = 1 ; your_fieldyour_field - GetNthRecord ( your_field ; Get ( RecordNumber ) - 1 ) )

           

          For the first record, the calculation will return the value of your_field. For all following records, the calculation will return the difference between your_field in the current record and your_field in the previous record.

           

          Nick

           

          • 2. Re: Calculation
            Tmmy

            Thanks, works perfect.

            Tmmy

            • 3. Re: Calculation
              philmodjunk

              Just be very careful with these kinds of calculations to keep control of your found set and sort order or you could get results that are not at all what you needed.