Solved

Sum Of Group In SSRS Report

Posted on 2016-07-21
18
80 Views
Last Modified: 2016-08-05
I have data like

target   Achieve
10            5
20            10
30            20

I want to sum in group as (5/10)+(10/20)+(20/30).
when I am summing it give as  5+10+20/10+20+30 .
Please provide me solution.
0
Comment
Question by:Naitik Gamit
  • 9
  • 7
  • 2
18 Comments
 
LVL 12

Expert Comment

by:Arifhusen Ansari
ID: 41724135
Could you please provide the expect output ??

It's not clear from your question.
0
 
LVL 8

Author Comment

by:Naitik Gamit
ID: 41724139
Hi,Arif

In my report I have column group A,B,C,D......Report look as

                       
                A      B      C      D
 target    10    20   30   40

Achieve   5      15   10    20

I want Sum(Achieve/target).................. but individually I mean 5/10+15/20 etc
when I write sUM(Fields!ACHIVEMENT.Value)/sUM(Fields!target.Value) it gives result of 5+15+10+20/10+20+30+40
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 41724142
 write it likr this
SUM(Fields!ACHIVEMENT.Value/Fields!target.Value) 
0
 
LVL 8

Author Comment

by:Naitik Gamit
ID: 41724144
Guy Hengel [angelIII / a3]

It show same result.... as 5+15+10+20/10+20+30+40  not as (5/10)+(15/20)..
0
 
LVL 12

Expert Comment

by:Arifhusen Ansari
ID: 41724145
Are you using matrix?
0
 
LVL 8

Author Comment

by:Naitik Gamit
ID: 41724147
No I am using tabular report and have column group..
0
 
LVL 12

Expert Comment

by:Arifhusen Ansari
ID: 41724149
Can you please post the screen shot of your report?
0
 
LVL 8

Author Comment

by:Naitik Gamit
ID: 41724156
tst.png
As per image I want sum of 0.5+0+1.33+2 in red colour textbox.
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 41724159
The 0 should be 1, but that apart...
Do you have an expression for that total line already? If yes use that one
You may also need to define scope
https://msdn.microsoft.com/en-us/library/dd255256.aspx
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 12

Expert Comment

by:Arifhusen Ansari
ID: 41724161
Use the same expression as you have used in text box in green back ground.

Refer the screen shot.
2016-07-22_12-46-44.png
0
 
LVL 8

Author Comment

by:Naitik Gamit
ID: 41724162
Guy Hengel [angelIII / a3] I am using expression as , sUM(Fields!ACHIVEMENT.Value)/sUM(Fields!target.Value) I am trying to give column group scope but it gives me error...can you please provide me example.
0
 
LVL 8

Author Comment

by:Naitik Gamit
ID: 41724164
Arif I  already use it but it gives all total not individually .......... it gives me result of 17/14 = 1.21 but I want 0.5+1+1.33+2=4.83
0
 
LVL 12

Expert Comment

by:Arifhusen Ansari
ID: 41724184
Hi,

I have attache the screen shot and the sample rdl as well.

Please have a look.
Report5.rdl
2016-07-22_13-13-09.png
0
 
LVL 8

Author Comment

by:Naitik Gamit
ID: 41724212
Arif it working only for sum , if we are doing division it show wrong result
0
 
LVL 12

Accepted Solution

by:
Arifhusen Ansari earned 500 total points
ID: 41724429
It's like tricky. You can do this but you have to add some custom code.

Add this code in the Report.

Public Function SetVariableValue(val as Microsoft.ReportingServices.ReportProcessing.OnDemandReportObjectModel.Variable, newval As Decimal ) as Decimal

val.Value = val.Value + newval 

Return Val.Value

End Function

Open in new window


Call this function from the Text box for total and in the last filed where you want the finale total.
just show the variable value.

Find the attached rdl.

Refer the below screenshot.

2016-07-22_15-09-22.png2016-07-22_15-15-51.pngReport5.rdl
1
 
LVL 8

Author Comment

by:Naitik Gamit
ID: 41724446
How to declare Reportvariable1 ?? and where ?? I cant find
0
 
LVL 12

Expert Comment

by:Arifhusen Ansari
ID: 41724457
In report property you can declare the variable.

Refer the screenshot.

2016-07-22_15-45-38.png
0
 
LVL 8

Author Comment

by:Naitik Gamit
ID: 41725792
Arif I am solving problem in sql so, thanks for your solution.............

can u help me to sum at group level.....I am trying as  Sum(Fields!WEIGHTAGE_ACHIVEMENT.Value,"Group_Name") but it gives error.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need help  to filter EndDates in my SSRS Report 10 50
SSRS report 5 50
Backup Exec 15 not showing job history in report if failed/cancelled. 9 103
SSRS Access Remotely 5 55
Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now