Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

I can't get the Sum of a Column

Avatar

Level 1

I was hoping someone would be able to help me figure out what I'm doing wrong on a form that I'm unable to get a SUM of a column for?  I'm new to LiveCycle Designer and have poured over all that I can find on the internet to figure this out but it's been 10+ hours and I'm no closer now then when I started. Specifically, I added a table to a form that has a multiplication formula set up in each of the ROWs (item * cost = total kind of scenario). These formula's work and give me the the $ amount in the last column titled "total." The problem is I can't figure out how to get a sum of the totals for the "grandtotal" cell at the bottom? Each formula I've tried gives me a warning that "total[*] is unknown" so it makes me think I have my cell menu's set up incorrectly since it's not registering it the $ amount in my "total" cells?  This is work project and I'm at a stopping point until I can figure this out so any help is gratefully appreciated.  Donna

 

Table/Row/Column Info:

My table is: table 3

My row is: cell1 (all are called cell1)

My column is total1 (I've changed these to total 1, total2, total3, etc in my efforts to troubleshoot)

FormCalc entries that I've tried:

Sum(total[*])

Sum(total[*]).amount[*])

$ = Sum(total1.amount + total1.amount + total3.amount)

Sum(table3.cell[*].total[*])

6 Replies

Avatar

Level 10

Keep the Row name same for all rows. And the column name is also same in every row.

table is: table3

row is: cell1 (all are called cell1)

column: total

Then use FormCalc language Calculate event.

     Sum(table3.cell[*].total);

Thanks

Srini

Avatar

Level 6

HI,

It appears you've phyically created 3 indivdual rows (correct me if I'm mistaken), so if that's the case...you can simply capature the GrandTotal by adding the fields using by their respective names. Thus, the GrandTotal script would be:  $ = Sum(total1+toal2+total3). Im not sure why you're using ".amount".

[*] is used when you have repeating subforms. So, say you started out with a single row (Row1) with the following fields: Qty, UnitCost, Total... where Total (field in last column) had the follwoing script: $ = Qty * UnitCost

If your form was "dynamic" and used an Add Row button, then you would only have to create one row and enable your user to "Add" additional rows, as needed.  As a result, you would need to use an array [*] to find all instances of Total on each row.

In that case, your script for GrandTotal would look like this: $ = Sum(Page1.Items.Row1[*].Total). Note: Page1.Items is the absoulte location for Row1 on my form, so this would change for you.

Going back to my previous comment, since your form doesn't appear to use an Add row button, you shoudl be able to add the fields names quite easily.

Lastly, as an FYI,  you shouldn't need a [*] after total in......Sum(table3.cell[*].total[*])

Let me know if this helps!

Thanks

Shaun

Avatar

Level 1

Shaun - I'm still not having any luck? I continue to get the same alert

telling me "total1 is unknown." I tend to get this alert with every

option I've been trying over the last few days.

Is tehre any chance I can send this form to you to check out? I hate to

ask this but I'm desperate!

Thanks Again!

Donna

Avatar

Level 6

Donna,

Yes, send it to shaunivan78@hotmail.com and I'll glady take a look.  In your email, please explain exactly what you're loking to do.

Thanks,

S

Avatar

Level 5

Hi Donna,

If you are able to post the form online (using acrobat.com or some other file sharing site) and then post the URL here then it may be that someone on the forum can help you. Many hands make light work and all that

Regards

Malcolm

Avatar

Level 1

Morning Malcolm,

I had emailed out my form before I saw this idea/suggestion. I will keep that in mind for the next time I'm stuck - thank you!

And a BIG THANKS to Shaun for fixing it!!!!

Donna