Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

LiveCycle 8.2 Calculate empty fields

Avatar

Level 1

I'd like to make a simple calulation i LC where one or more of the cells contains no data. The following works well: Numericfield1*Numericfield2*Numericfield3 and so on, as long as all cells contains data, with one or more empty cells it all ends out with = 0. Is there any possibility to calculate all cells also them with no data, or set cells with no data to 1, but invisible for the user?

Thanks in advance

2 Replies

Avatar

Former Community Member

Here is a solution that produces the following results....

p.png

Where cell labelled 'A*B*C' has a FormCalc calculate event as depicted by row[0], below

// form1.page1.subform1.table.row[0].sum::calculate - (FormCalc, client)

var sum = row[0].a + row[0].b + row[0].c

if (sum == 0) then

    0

else

    Max(row[0].a,1) * Max(row[0].b,1) * Max(row[0].c,1)

endif

p1.png

Steve

Avatar

Level 1

Thank you, it works like a charm.

-Zjur