Sum Function

1,240 views
Skip to first unread message

Worst, Debbie

unread,
Feb 4, 2011, 12:05:05 PM2/4/11
to live...@googlegroups.com
How do I sum multiple numeric fields across my form into a total.  I've done it before when I've used a table with a Header, but not individual fields.
 
Thanks,
 
Debbie
 
 

********************************************************************** The content of this e-mail message and any attachments are confidential and may be legally privileged, intended solely for the addressee. If you are not the intended recipient, be advised that any use, dissemination, distribution, or copying of this e-mail is strictly prohibited. If you receive this message in error, please notify the sender immediately by reply email and destroy the message and its attachments. **********************************************************************

Jono Moore

unread,
Feb 4, 2011, 12:15:40 PM2/4/11
to live...@googlegroups.com
On Friday, February 4, 2011 9:05:05 AM UTC-8, Worsty wrote:
How do I sum multiple numeric fields across my form into a total.  I've done it before when I've used a table with a Header, but not individual fields.

Are they in repeating subforms or just standalone fields?

With FormCalc it's just a matter of using "sum(field, field, field)" or even a string of "field+field+field". If the fields are in different subforms you will need to specify the path to the fields "sum(subform1.subform2.field, subform3.field)".

If you have repeating subforms with the same field name to total you can use FormCalc's wildcards e.g. "sum(subform[*].field)". 

Worst, Debbie

unread,
Feb 4, 2011, 12:17:11 PM2/4/11
to live...@googlegroups.com
standalone fields on the same page and I'm using Javascript.
 

Deborah A. Worst, AINS, AIC
Office Solutions Team
513-345-6462

"Learning is a name superior to beauty; learning is better than hidden treasure.....learning is strength inexhaustible."

The Hitopadesa

 


From: live...@googlegroups.com [mailto:live...@googlegroups.com] On Behalf Of Jono Moore
Sent: Friday, February 04, 2011 12:16 PM
To: live...@googlegroups.com
Subject: Re: Sum Function

--
You received this message because you are subscribed to the Google Groups "Adobe LiveCycle Developers" group.
To post to this group, send email to live...@googlegroups.com.
To unsubscribe from this group, send email to livecycle+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/livecycle?hl=en.

Jono Moore

unread,
Feb 4, 2011, 12:37:29 PM2/4/11
to live...@googlegroups.com
On Friday, February 4, 2011 9:17:11 AM UTC-8, Worsty wrote:
standalone fields on the same page and I'm using Javascript.

Sort-of similar but you have to use the rawValue.

So you'd have "this.rawValue = field.rawValue + field.rawValue + field.rawValue;"

You can also mix FormCalc and JavaScript in your forms, just not on the same event. I'll quite often use FormCalc for math because it's simpler.

Duane Nickull

unread,
Feb 4, 2011, 12:41:24 PM2/4/11
to live...@googlegroups.com
Debbie - I will build you a form and post it to the forum here.

Duane

********
22nd Century (my band) - http://22ndcenturyofficial.com/
Twitter - @duanechaos
********



Worst, Debbie

unread,
Feb 4, 2011, 12:50:46 PM2/4/11
to live...@googlegroups.com
I have the javascript working now, but the Total field has "0.00" in it when there are no values in the calculating fields.  I don't want the zeros to show.  How would I do that?
 

Deborah A. Worst, AINS, AIC
Office Solutions Team
513-345-6462

"Learning is a name superior to beauty; learning is better than hidden treasure.....learning is strength inexhaustible."

The Hitopadesa

 


From: live...@googlegroups.com [mailto:live...@googlegroups.com] On Behalf Of Duane Nickull
Sent: Friday, February 04, 2011 12:41 PM

To: live...@googlegroups.com
Subject: Re: Sum Function

Duane Nickull

unread,
Feb 4, 2011, 1:01:02 PM2/4/11
to Adobe LiveCycle Developers
Will post in 3 minutes

---
Adobe LiveCycle Enterprise Architecture - http://www.adobe.com/products/livecycle/
TV Show - http://tv.adobe.com/show/duanes-world/
Blog – http://technoracle.blogspot.com/
Music – http://22ndcenturyofficial.com/
Twitter – http://twitter.com/duanechaos/
“That’s all I have time for”

Jono Moore

unread,
Feb 4, 2011, 1:03:12 PM2/4/11
to live...@googlegroups.com
On Friday, February 4, 2011 9:50:46 AM UTC-8, Worsty wrote:
I have the javascript working now, but the Total field has "0.00" in it when there are no values in the calculating fields.  I don't want the zeros to show.  How would I do that?

 In the Display Pattern for the total field click the "Allow Zero" checkbox.

Falor, Brian

unread,
Feb 4, 2011, 1:03:12 PM2/4/11
to live...@googlegroups.com

If (Field.rawValue == 0)

                {

                Field.rawValue = “”;

                }

 

This will give you a blank value if the field equals 0.


CONFIDENTIAL NOTICE: This e-mail transmission (and the attachments, if any, accompanying it) may contain confidential information. The information is intended only for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that any forwarding, disclosure, copying, distribution, or the taking of any action in reliance on the contents of this information is strictly prohibited. Any unauthorized interception of this transmission is illegal under the law. If you have received this transmission in error, please promptly notify the sender by reply e-mail, and then destroy all copies of the transmission.

Duane Nickull

unread,
Feb 4, 2011, 1:03:27 PM2/4/11
to live...@googlegroups.com
Here is the form.  It uses a combination of events to make the calculations but you can set the addition to happen based on your own events.  For formatting, select "Value > Validation Pattern" as shown on the form.

Duane
FormAddingSumsTogether.xdp
Picture 202.png

Worst, Debbie

unread,
Feb 4, 2011, 1:20:19 PM2/4/11
to live...@googlegroups.com
Thanks everyone for the help!  Works like a charm.
 

Deborah A. Worst, AINS, AIC
Office Solutions Team
513-345-6462

"Learning is a name superior to beauty; learning is better than hidden treasure.....learning is strength inexhaustible."

The Hitopadesa

 

From: live...@googlegroups.com [mailto:live...@googlegroups.com] On Behalf Of Duane Nickull
Sent: Friday, February 04, 2011 1:03 PM

To: live...@googlegroups.com
Subject: Re: Sum Function
Here is the form.  It uses a combination of events to make the calculations but you can set the addition to happen based on your own events.  For formatting, select "Value > Validation Pattern" as shown on the form.

Duane

Reply all
Reply to author
Forward
0 new messages