Forgive me... I'm a total newby at livecycle. I have a dynamic table where the user starts out with only one row for information, but can add rows as needed (add instance) to list more buildings. Among other things, they must indicate the location of the building (from a drop down menu - ie. there is a binding value for each location) and an amount representing the insurable value of the building.
In a totally different subform I can generate the grand total quite nicely using formcalc: sum (Buildings.Row4[*].Amount[*])
But how would I generate a sum for each location? In other words, use the location as the criteria for amounts that get lumped together.
You can use a for loop to do this.
This example sums all locations named LC3.
var s = 0
for i=0 upto Buildings._Row.count -1 do
if (Buildings.Row[i].Location eq "LC3") then
s = sum(s, Buildings.Row[i].Amount)
$ = s
Thanks very much. That worked perfectly.