I'm trying to compute the difference between two columns in a crosstab.
The columns are generated based on a year value in the data source (spanning the last 5 years) and the field values are counts of the number of items in the data set that fall in the given year. I'm trying to add a column at the end which shows the increase/decrease in the counts between two of those columns (the first year in the 5-year period and the last year in the 5-year period). Since I don't know what the values of those years are, I need to determine those at runtime. (See ASCII example below)
Is there an easy way to do this? I've created a report parameter based on a stored procedure which gets me the value of the last year and then I calculate 5 years back from there but it doesn't seem like a very elegant solution.
Thanks,
Chris N
2011 2012 2013 2014 2015 5Y Increase
------------------------------------------------------------
3 4 3 6 10 7