Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Count If Values in Dynamic Nested Tables

Avatar

Level 2

Have an expanding table nested in another expanding table.  Attempting to count the number of times:

The value in the "DateTimeField2" field in the last row of the nested table on the previous row of the main table is equal to

The value in the "DateTimeField2" field in the first row of the nested table on the next row of the main table.

This one is driving me nuts, any help would be greatly appreciated.  Here is what I have so far.  Thanks again!

var sumDCD = 0;

var dcd = this.resolveNodes("RowX[*].Subform2[*].Table1[*]");

//app.alert(dcd.length);

for (var i = 1; i < dcd.length; i++)

{

var row = this.resolveNodes("RowX[*].Subform2[*].resolvenode[" + (Table1[i-1]._Row1.count - 1) + "]");

if(dcd.item(i).DateTimeField2.Row1[row].rawValue = dcd.item(i-1).Row1[0].DateTimeField2.rawValue)

{

sumDCD += (dcd.item(i).Row1.DateTimeField2.length);

}

}

sumDCD

1 Reply

Avatar

Level 2

Anyone have any thoughts?  Still have not been able to get this working despite significant tinkering.