I’m building a report in Visual Studio 2017 (SSRS) and it uses a stored procedure that returns the following data:
PRODUCT_ID TYPE YEAR STATUS
15242 01 1516 ACTIVE
54541 02 1617 ACTIVE
64454 01 1516 INACTIVE
73697 02 1516 INACTIVE
98878 03 1617 ACTIVE
I needed to get the counts per status, per year, per type, so I started building a matrix with STATUS as first column group and YEAR as its child, then, in the row group I only have TYPE. In the data fields I only have the count, so it looks like this:
ACTIVE INACTIVE
1516 1617 1516 1617
01 1 0 1 0
02 0 1 1 0
03 0 1 0 0
My problem is the following. I want add a DIFF column (example below) that calculates the difference between the two years, but the problem is that since all is done dynamically, I don’t know how to access the text boxes with the counts to calculate the difference. I could build a stored procedure that calculates all those numbers, but it would be a slower solution since the field TYPE will grow over time.
ACTIVE INACTIVE
1516 1617 DIFF 1516 1617 DIFF
01 1 0 1 1 0 1
02 0 1 1 1 0 1
03 0 1 1 0 0 0
Any help will be appreciated. Thank you guys in advance.