You are viewing limited content. For full access, please sign in.

Question

Question

Calculate Function with Forms 10

asked on January 27, 2017

I am looking to add values of a collection together to give me a Total quantity and Total Weight.  I'm using the new calculate functions introduced in Forms 10.  I have the following formula in my Fields: =SUM(Shipment_Collection.Qauntity) & =SUM(Shipment_Collection.Weight).  The number of values in my collection is NOT static but I am not getting any result when I change the value in either first or second collection.  Let me know what I am doing wrong.  

Thanks,

Nate

0 0

Answer

SELECTED ANSWER
replied on January 27, 2017

Hi Nate,

Your formulas look right, so there's a couple other things you may want to check. When you say you're not getting any result, is your calculation filled with a zero, or is it blank?

If you get "0," can you verify that your weight and quantity fields within your collection are number fields? 

2 0
replied on January 27, 2017

I was not aware that the fields had to be number fields.  That did it for me.  Thanks Anita.  

0 0
replied on January 28, 2017

The reason for this is that if the field is a single-line field, the data type of the field value for purposes of calculations is Text. The SUM formula requires Number types (or a NumberSequence) as arguments, however, so the value needs to be converted to a Number. By the OpenFormula specifications, Text types must either throw an error or be treated as zero, which is why the sum of "1" and "2" (as Text strings) is 0. This is by design in case of string values which do not correspond to actual numbers.

If the single-line fields are not part of a table or collection, you could sum them using the VALUE() function; for example:

=SUM(VALUE(Field1), VALUE(Field2), ... , VALUE(FieldN))

However if any of these are not valid Number values, this calculation will return an error. Also this does not work with table columns or fields in a collection.

2 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.