Report Designer Plugin Aggregrate function (key)

I am looking to perform a subtract function on a column of a dataset (with 2 rows) from within the report plugin. I want to do just the opposite of what the TOTAL key does. Is there an easy way to do this?

Thanks

Sure, just put a keychain expression like this in a text box in your report:

@Data[0].Value - Data[1].Value@

i have a data set with multiple rows, and multiple columns. lets say, ID from 1 to 10.

How do i subtract column1 with id1 from column1 with id2 and so on, and do that with all the columns?

I don’t think it’s possible to reference previous rows in the Reporting Plugin. I entered a feature request for a keyword like Last or Previous. In your case it would be @Col1-Last.Col1@.

There is probably a way to get the difference of a columns value between rows. I can’t think of how. This article might point you in the right direction.

Usually this is done in a SQL query that joins the table together, like:

SELECT A.Col1-B.Col1 FROM MyTable A JOIN MyTable B ON A.Id=B.Id-1