This is a migrated thread and some comments may be shown as answers.

Division between two sums

2 Answers 424 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Cleonara
Top achievements
Rank 1
Cleonara asked on 06 Dec 2017, 07:04 PM

Hi!

I have a chart in my report where I print inspections that are divided between finished and unfinished. I get this data from a database field and at the end of my report I created another field called total that sums up all of these numbers. 
What I need to do next is to get the percentage of how many of these inspections are finished and unfinished, and for that I need to get the sum of each one of the fields and divide by the sum of all finished and unfinished inspections, what should be something like this:

= (((Sum(Fields.FinishedInsp))/((Sum(Fields.FinishedInsp))+(Sum(Fields.UnfinishedInsp))))-1)*100

But I noticed that Telerik always return 0 for a division between two Sum() functions instead of the actual value, any idea why am I getting 0 and how to fix the problem?


2 Answers, 1 is accepted

Sort by
0
Brian
Top achievements
Rank 1
answered on 11 Jan 2018, 02:05 PM

Not sure what the issue is. 

However, as an alternative, could you do this as a subquery directly in the query? 

Perhaps attach the report so we can take a peak and see what is going on? At first glance, i can't see an issue.

1
Noah
Top achievements
Rank 2
answered on 04 Jun 2020, 05:08 PM

In case anyone else finds this post and is looking for the answer:

Both inputs have to be a Double in order to return a double so that you can format it as a percentage - otherwise it gets truncated and returns a zero.

= CDbl(SUM(Fields.HazardNumberOutSIF)) / CDbl(SUM(Fields.HazardNumberOut))

Doors
Top achievements
Rank 2
Iron
commented on 24 May 2022, 01:47 PM

You are great thanks
Tags
Report Designer (standalone)
Asked by
Cleonara
Top achievements
Rank 1
Answers by
Brian
Top achievements
Rank 1
Noah
Top achievements
Rank 2
Share this question
or