3 Replies Latest reply: May 15, 2014 10:00 AM by Olly Bond RSS

    A way to do calculations between data rows

    cdevans7 _

      I was stumped with a problem that each line of data had an ending time. (The data was generated on a production machine with an automatic time stamp on the data).

      I wanted to calculate the time between one data entry to the next data entry.

      To the best of my knowledge Monarch has no straight froward way to do math calculations between[/B] rows of data.

      The solution I came up with was to create two new calculated fields. One was rowno() and the second was rowno()-1.

      I then exported the table, with these calulated fields to a .mdb file.

      Next step was to open the newly created .mdb file and then do an external lookup back to the same[/B] .mdb file.

      By matching rowno() with rowno()-1 I was able to pull the time stamp data from the previous[/B] row.

      Simple task from there to do the math and calculate the time between events.:)

        • A way to do calculations between data rows
          Olly Bond

          Dear CD Evans,


          Using a two-pass project like you describe is frequently the most flexible way to cope with data where you need to handle the relationship between rows.


          There might, though, be a chance in your case to use a single-pass model, as the data is always at the end of the previous row, by using an Append/Detail or Detail/Footer pair of templates. If you want to see an example, please feel free to email me a sample report.


          You'll need to watch out for exceptions in the first and last rows of data in either case.


          Best wishes,