I'm working on an expense form that requires receipts for expenses to be attached unless the expense is a parking meter, in which case no receipt is required. The expense claims are in a repeating table, with a field for mileage, a field for expenses, and a checkbox to indicate if it was a parking meter expense. The form is laid out as follows:
Group: MileageExpenses
Repeating Table: expenseLineItem
Field: Distance
Field: Expenses
Checkbox: meterParking
hidden Field: subTotal (calculated as rate * distance + expenses)
I then have another section called Attachments. I have a conditional format to hide this section, and the expression I defined as: count(../my:expenseLineItem/my:Expenses[. > 0]) = count(../my:expenseLineItem/my:meterParking[. > 0])
It's not working, and I'm not sure why not. The logic seems to be fine: if the count of Expenses fields larger than zero equals the count of meterParking fields with a tick, then I'm assuming all Expenses are meters, and no attachments are required. When I run the form, the section is hidden, and it doesn't matter how many lines with expenses I add, the section never appears.