Another way to do this using more of the native function of the Matrix would be to create a grouping column, where one group value is tied to the Articles sold and another group value tied to the Target information.
Group 01 is the Articles sold.
Group 02 is the target.
The data set would look like:
grp Name Month #Sold
== ==== ===== ====
01 Franz 200801 10
01 Franz 200803 7
01 Franz 200804 12
02 Franz Target -20 (Trick:note negative Target value is need to make the "math" ok when sub totalling)
Then just set up totalling on your matrix report to provide sub totals per the group value.
1) In order for the final total to come out correctly the Target data needs to go in as a negative number
2) You would have to have a special format option when displaying the "target" data to not show the negative
3) You would still need to use the techniques, described in the article, for proper sequencing and column headers and such on the final report.
- Your data set only has raw data in it, rather than mixing raw data and summary data.
- Much Simpler T-SQl statements
- Lets the matrix list do what it does best.