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.
Location | Amount |
---|---|
LC1 | $ 100,000 |
LC1 | $ 125,000 |
LC1 | $ 100,000 |
LC2 | $ 150,000 |
LC2 | $ 130,000 |
LC3 | $ 200,000 |
LC3 | $ 175,000 |
LC3 | $ 100,000 |
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.
Solved! Go to Solution.
Views
Replies
Total Likes
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)
endif
endfor
$ = s
Views
Replies
Total Likes
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)
endif
endfor
$ = s
Views
Replies
Total Likes
Thanks very much. That worked perfectly.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies