0
votes

Hello awesome people of stackoverflow!

I need help with a simple problem with my SSRS expression. How could I do this in SSRS? enter image description here

As you can on the 2nd table below in my excel screenshot. for each row we divide -BC5...-BC10 to column/row BC4. To get the desired results for table 2 in excel column total 2018 into column/rows BC17 upto BC22.

I've tried referencing my textbox like this ReportItems!TextBox1.Value / ReportItems!TextBox2.Value. But got me the wrong values. enter image description here enter image description here Can someone please help.

Thank you!

2

2 Answers

1
votes

There is not enough info to give you an exact answer but you should be able to work it out.

The first thing you need to do is get the context of the aggregations you want to work with. So click on the cell containing the number you want to divide ([Sum(DiscountOERestated)] ). In the row and column groups panel near the bottom on the screen, look at the row group that is highlighted. For this example I'll assume the row group is called grpCategory.

Now we need to do the same for GrossCatalogRestated. However, GrossCatalogRestated in the top tablix does not appear to be an aggregate. I'll assume it should be the total GrossCatalogRestated for the dataset. For this exmaple, we'll say the dataset name is dsMyDataSet. If it's within a row group, just swap the dataset name out with the row group name that it sits in, just like we did for DiscountOERestated .

So you expression would look something like

=SUM(Fields!DiscountOERestated.Value, "grpCategory") / SUM(Fields!GrossCatalogRestated .Value, "myDataSetName")

This will give you a deicmal result, somehting like 0.025 . You then just need to set the format property to say, "p1", so it shows as 2.5%

If this does not work, edit your question to show the expressions in the cells you are working with along with the rowgroup and dataset names.

2
votes

If those two tables are in the same table/tablix then it should work with the expression that you wrote (try to type it instead of copy paste sometimes that may work).

=(ReportItems!Textbox7.Value /ReportItems!Textbox1.Value) * 100

If they are not in the same Table/Tablix then you should write like the following:

=(Fields!ColumnName1.Value / Fields!ColumnName2.Value) * 100

Format your cells.