Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

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.