Question

I working on a report using a matrix with SSRS 2008:

Here's what the report is based on:

Groups:

Row group: Sales Rep

Column group: Date (year/month)

Data:

  • Count of sales type 1
  • Count of sales type 2
  • Ratio (%) of both sales types count
  • Bonus: the bonus is based on a certain percentage of the ratio and is calculated with the textbox expression.

        Rep     Type 1      Type 2      Ratio   Bonus
        A       13          0           0       325
        B       26          2           7.7     0
        C       23          1           4.3     220 
    

    The ratio is calculated by dividing Type 2 by Type 1.

    The bonus is calculated like this: If the ratio is between 0 and 0.03, then substract Type2 from Type1 then multiply by 25 If the ratio is less of equal than 0.04 but bigger than 0.03, then substract Type2 from Type1 then multiply by 15 If the ratio is smaller than 0.05 but bigger than 0.04, then substract Type2 from Type1 then multiply by 10 If the ratio is higher than 0.05 then bonus = 0

There’s a bonus total for each rep for the report’s period (months displayed on the report columns) outside the column group using a function which tallies the bonuses and resets the bonus sub total after each row.

Now, what I need to achieve is a column total of all bonuses given. Since the Bonus textbox is based on an expression, I can’t add a total (SUM) and since the bonuses are calculated for each individual sales rep and their own ratio, I can’t use the row group totals to do the calculations.

How can I achieve this?

Thank you

Was it helpful?

Solution

I would move the whole Ratio and Bonus calculation upstream e.g. into SQL in the Dataset.

This also has the advantage of being easier to test as you can run the SQL independantly of SSRS.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top