# how ca I calulate the matrix

### Question

•  different kilogram of bags 50 60 100 190 200 220 270 300 350 360 370 400 410 420 430 440 450 different Person 1 150,000 2 10,000 3 35,320 4 12,175 5 247,738 6 135,800 7 39,650 8 11,050 9 335,000 10 41,100 11 9,250 12 20,000 13 10,000 14 56,800 15 20,000 16 119,150 17 18,780 18 47,760 19 94,000 20 10,000 21 87,045 22 60,000 24 67,000 26 30,000 27 20,180 28 20,000 29 20,140 32 350 33 10,000 35 4,000 35 13 61 1 1 1 2 1 2 7 3 905 2 3243 52 17 70 Total available of Bags
Thursday, September 05, 2013 4:41 AM

• Hi Berihu,

If I understand correctly, you want to calculate bags total weight in the last column, and count bags in the last row.

I created a simple report in my test environment. You can refer to the following steps. I created a dataset with two fields: Number_ID and Kilogram.
1. Add a matrix in the report body.
2. Add a row group, group by [Number_ID].
3. Add a column group, group by:
=IIF(Fields!Kilogram.Value<=50,"50",(IIF(Fields!Kilogram.Value>50 AND Fields!Kilogram.Value<=70,"70","100")))
4. Add [Kilogram] in detail data textbox.
Finish this steps, we can get a simple matrix as your post.
5. In Column Groups dialog box, right click [Group1]. Add total -> After.
6. Add a row in matrix below. Type specify expression below Details Data textbox. You can refer to the expression below:
=Sum(Count(Fields!Kilogram.Value))

You can refer to the screenshots below:
Report design:

Preview the report:

Hope this help. If there are any misunderstanding, please feel free to let me know.

Regards,
Alisa Tang

Friday, September 06, 2013 7:19 AM
• Hi Berihu,

It is addition for my post above. If we want get a detail data in matrix, we can recreate row group in our matrix.

You can refer to the following steps:
1. Right click Number_ID in Row Groups dialog box. Select Group Properties.
2. Select “Group on:” under “Group expressions:”, and click Delete.
3. Right click (Details), select Add Group -> Parent Group ->Group by [Number_ID].
4. Right click (Details), select Add Total ->Below. Delete Number_ID column in the matrix.
5. Preview the report, we can get the report like the screen shot below:

Preview the report:

If you have any problem, please feel free to let me know.

Regards,
Alisa Tang

Friday, September 13, 2013 8:41 AM

### All replies

• Hi Berihu,

If I understand correctly, you want to calculate bags total weight in the last column, and count bags in the last row.

I created a simple report in my test environment. You can refer to the following steps. I created a dataset with two fields: Number_ID and Kilogram.
1. Add a matrix in the report body.
2. Add a row group, group by [Number_ID].
3. Add a column group, group by:
=IIF(Fields!Kilogram.Value<=50,"50",(IIF(Fields!Kilogram.Value>50 AND Fields!Kilogram.Value<=70,"70","100")))
4. Add [Kilogram] in detail data textbox.
Finish this steps, we can get a simple matrix as your post.
5. In Column Groups dialog box, right click [Group1]. Add total -> After.
6. Add a row in matrix below. Type specify expression below Details Data textbox. You can refer to the expression below:
=Sum(Count(Fields!Kilogram.Value))

You can refer to the screenshots below:
Report design:

Preview the report:

Hope this help. If there are any misunderstanding, please feel free to let me know.

Regards,
Alisa Tang

Friday, September 06, 2013 7:19 AM
• Hi Berihu,

It is addition for my post above. If we want get a detail data in matrix, we can recreate row group in our matrix.

You can refer to the following steps:
1. Right click Number_ID in Row Groups dialog box. Select Group Properties.
2. Select “Group on:” under “Group expressions:”, and click Delete.
3. Right click (Details), select Add Group -> Parent Group ->Group by [Number_ID].
4. Right click (Details), select Add Total ->Below. Delete Number_ID column in the matrix.
5. Preview the report, we can get the report like the screen shot below:

Preview the report:

If you have any problem, please feel free to let me know.

Regards,
Alisa Tang

Friday, September 13, 2013 8:41 AM