Expand my Community achievements bar.

Formula Problems

Avatar

Former Community Member
Hey,



Im trying to get a form to add subform Totals that have various instances.



the Totals are locate here:




1.

1.1

1.1.1 this is the Totals

1.1.2

1.2

1.3



2.GrandTotal
(this.rawValue = Totals.rawValue * Totals(*).rawValue;)



# 1.1 has independent instances

# 1.1.1 has no independent instances

# 1.1.2 has independent instances



I can't get the GrandTotal to display the sddition

of all instances of total.



Hope this makes sense, thanks in advance for any assistance.



Camilo
6 Replies

Avatar

Level 6
I'm not sure that I understand exactly what you want to do, but I may be able to help. If you want to sum all instances of something, it can be done in JavaScript, but is easier using FormCalc. For example, if you have many instances of a field called Total, then on the calculate event of GrandTotal, set the scripting language to FormCalc and type Sum(Total[*]).



Jared Langdon

www.jlangdon.ca

Avatar

Former Community Member
Jared,



How is this done if the instances are or could be on multiple pages. ?Static form

Avatar

Level 6
Okay, so you have multiple instances of a field on a static form, but on different pages. Should I assume then that the pages are not named subforms? If they were named the objects would have different SOMs, and could not really be called multiple instances.

Avatar

Former Community Member
Perhaps my wording is not correct speak for the programming world. To clarify:



Document structure:



form1

+ (Master Pages)

+ specSheet

+ specsheet2

+ shipDimensions



It is the specSheets that will have the tables on. The tables are the same name via copy/paste and may continue on other sheets as needed. One column (SKU#) contains the data to be totaled. I only want the total object on the first page but I want it to include the data in the SKU# columns on all pages.

So if I add specSheet3 it would be easy for me to include that too.

The form is static because when I tried a dynamic form the processor basically really struggled. There are 14 columns and more than 20 rows per table so Im sure this had an impact.



Im not sure right now what SOMs are. The instances I was referring to are the SKU# cells.



I have managed to get a result by using hidden subTotal objects:

sum(subTsku1,form1.specSheet2.subTsku2)



I was asking if there were a way to do it with creating hidden subTotal objects.



Im only a week in to this so bear with the simplicity.

Avatar

Former Community Member
I meant to say "without" hidden subtotals.



And, I figured it out



sum(Table10.Row1[*].NumericField1[*],specSheet2.Table10.Row1[*].NumericField1[*])



However, while it works, and seems relatively simple I am not sure if it is the best or simplest method.



Ive eliminated 2 subtotal number fields, which raises the question of what factors affect the performance of a document?

Avatar

Level 6
I think what you've done is the best and simplest method.