find the difference between two columns in an ssrs matrix

老子叫甜甜 提交于 2019-12-25 02:25:00

问题


I have the following ssrs matrix that I am building :

Month(Column)
Sales(Rows)               SalesData (Data)

My data looks something like this :

           Jan  Feb March 

  Sales     10    3   9

What I would like to do now is to find the difference between each of the rows to show something like :

            Jan   Feb  March
Sales        10    3    9
#change           -7    6

In an ssrs table its a simple expression .

I do not know how I need to do it in a matrix since the Months Columns are generated dynamically

Please direct me..

Just wanted to add this to clarify :

This is how my matrix looks

                          Month(Column)
Sales(Rows)               SalesData (Data)

回答1:


If you right click on the row group and put 'Add Total'

After

Then click on the area that they up the Total for you. In the value section add an expression like: Fields!YourOtherFieldToCalculate.Value - Fields!YourFieldToCalculate.Value

If you are dealing with the same values you could add this

ReportItems!SomeTextBox.Value - ReportItems!SomeOtherTextBox.Value

(though I think you would have to add it into the footer)

With your new clarification I would go with Sam's use of Previous: though I would have used but his checks for nulls which is a good thing!

=Fields!Column.Value - Previous(Fields!Column.Value)


来源:https://stackoverflow.com/questions/20148560/find-the-difference-between-two-columns-in-an-ssrs-matrix

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!