I'm getting an error when trying to build an expression on one of my fields in a form. I'm trying to get the duration of days between two dates. The expression is below and it seems to be pointing at the number 2 at the end of the expression.
concat(substring-before(., ";") + substring-after(., ";") * ((translate(addDays(../my:BackDateTo, substring-before(., ";")), "-", "") < translate(../my:EndLastBillingCycle, "-", "")) * 2 - 1), ";", substring-after(., ";") / 2)