Here are a couple possibilities. You could use a hidden text box before your table to force a run of the dataSet, store your dataSet values in an array in the onFetch of the dataSet, and then use this array to know the next value before getting to the next row in your table. You could create duplicate tables, hiding the first to get the values needed for your computation. Or, you could use the data engine API to step through your dataSet results and use the returned values to do your calculations. Let me know if you need further explanation on any of these.