Dear All,
I am having one problem in calculating subtotal for the group filter to show top 2 values. Here is my requirement
Date set
Product | Product Subcategory | Amount |
Mens | Shirts | 100 |
Mens | T Shirts | 50 |
Mens | Pants | 150 |
Mens | Tie | 20 |
Mens | Polo Shirt | 75 |
Ladies | Shirts | 80 |
Ladies | T Shirts | 50 |
Ladies | Pants | 85 |
Kids | Shirts | 55 |
Kids | Pants | 70 |
Kids | shoes | 50 |
i want to group by product and to show only top 2 product sub categories based on Amount value. So my output should be
Product | Product Subcategory | Amount | Contribution |
Mens | Pants | 150 | 60% |
Shirts | 100 | 40% | |
Total | 250 | 100% | |
Ladies | Pants | 85 | 51.50% |
Shirts | 80 | 48.50% | |
Total | 165 | 100% | |
Kids | Pants | 70 | 56% |
Shirts | 55 | 44% | |
Total | 125 | 100% |
Here contribution is nothing but Amount/Total
I used tablix to show the data. I added one group to group by product and in the detail group i filtered to show only top 2 values of product subcategory based on amount. it works fine and shows the correct data.
My problems are
1. the subtotal for the group is not for the filterd data, it is for all the data in the group(in m case, it should be 250 but it shows 395 for men.
i gone thru lot of forums and got the workaround to solve this issue like
i added two more rows in the group , in the first row text box(name is top2valuesamount) i use =RunningValue(Fields!ItemNetSalesAmt.Value, Sum, "Nothing") to get the total amount for the filtered records, then i hide the row
in the second row i just show the value of the top2valuesamount, text box in the text box(Name is totaltop2valuesamount) i.e =reportitems!top2valuesamount.value
is there any other way to do this?
2. i get the total value for the filtered records. that is fine. But when i calculate the contribution values i am having some problem. I use this expression = Fields!ItemNetSalesAmt.Value/reportitems!Totaltop2valuesamount.value but i dont get the correct value. i understand that when the SSRS calculate this the value of the reportitems!Totaltop2valuesamount is the first value of the group. i tried changing the expression in to = Fields!ItemNetSalesAmt.Value/reportitems!top2valuesamount.value, but this time also it is not right. I understand that here the value of the reportitems!top2valuesamount is the runningvalue value.
I hope i am clear in my requirement.
Kindly help me to solve this issue.
Thanks in Advance.
Regards,
Thaya