10 Replies Latest reply on Jul 26, 2012 8:30 PM by TKnTexas

# Division by sum

### Title

Division by sum

### Post

Is it possible to divide the sum of a field by 2?

How do i write the calculation for that?

Would appreciate the help on how to do that?

• ###### 1. Re: Division by sum

What do you mean by the 'sum of a field'?

• ###### 2. Re: Division by sum

Sum as in adding all the number field together.

• ###### 3. Re: Division by sum

But what fields are you adding?  Not that it matters, really - but there's clearly more to this than simply "how do I divide a number by 2?".  Whatever you were going to tell me was how you sum the numbers, I was expecting to suggest you just divide it by two.  The sum function works two ways.  If you have some number fields in the record it can add them together:

Sum ( Field1 ; Field2 ; Field3 )

If you want to add the values in a number field in every related record, you can use:

Sum ( Relationship::NumberField )

In both those examples just dividing that by 2 will give you the answer.

• ###### 4. Re: Division by sum

Hi,

But can i know what is the divide sign?

Thanks.

• ###### 5. Re: Division by sum

( (Sum ( Twin )) / 2 )

The above is my calculation, but it doesn't seem to work. The Field is Twin, which is a number field already.

I want to divide it by 2, but it came up as 0 instead.

• ###### 6. Re: Division by sum

If the field Twin is a number field already, why are you trying to Sum it?  Your expression will take the one field (Twin) in the one record you are looking at, and divide its value by two.  I am assuming it is not a repeating field.

What value is in the field Twin?

• ###### 7. Re: Division by sum

The field value of twin is 1.

and there are either 1 or 0 in the various records.

and i would like to add all of the twins in the records together then divde it by 2.

• ###### 8. Re: Division by sum

The calculation you are using is for THAT single record, not a group of records.  You will need a summary field for that.  You could also use Getsummary with the summary field.

• ###### 9. Re: Division by sum

OK thanks.

But when i use the Getsummary, i will get this message:

Only summary fields are allowed as the first arguement in a Getsummary function.

• ###### 10. Re: Division by sum

Here is a quick screen print showing my example.  In my example each record is a family, with the State they are in and number of kids.  Then I create NumKids.sum (my notation indicating the summary field of NumKids.  Use the Summary field in Subsummary parts of a layout,  when creating a report.  For my example sort of State.  DispSumm is a calculation field to do math on Summary Field.   Hopefully this helps.