Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

if / then calculation based on dropdown list value in repeating row

Avatar

Level 1

Hello

I am new to Livecycle. I have created a repeating row in a form. The last field in the repeating row is a numeric field that = the product of two previous fields in the row (NumericField1 *  Numeric Field2). I also have a DropDownList1 near the beginning of the row (third column) that contains variable categories for that calculation row, e.g. Advertising, Office Supplies, Entertainment. I would like to create numeric fields in the form (perhaps in a footer row?) that contain sums of the subtotals of each row, depending on the category selected in DropDownList1. In other words I need to create a subtotal field for all calculations beginning with the category of Advertising, another for Office Supplies, another for Entertainment.

From what I understand I need to list the variables first, then create an if/then calculation but I am not sure about the steps involved in creating the script.

df

2 Replies

Avatar

Level 1

NumericField3 is the name of the field containing the product of NumericField1 * NumericField2. I have created a NumericField8 in the form with the following calculation in FormCalc:

if(Table1.Row.DropDownList1.rawValue == "ADVERTISING") then

sum(Table1.Row[*].NumericField3)

end if

That's not helping. I think I need to designate variables before the if/then script, yes? Would I need to use a resolve command, a getfield command, or . . .? Can anyone help?

Thanks, in advance,

df

Avatar

Level 1

Or do I / can I nest an if/then statement within a sum calculation? If so, how?

Cheers,

df