I need to add an InfoPath formula such as the following:

if(Unit = "Percent"){
   Numerator / Denominator *100}


I know the formating something like (TrueResult | ElseResult) [(BoolCondition) + 1]

Converted: ((Numerator / Denominator * 100) | Numerator ) [(KD-N_Unit = "Percentage") + 1]

but i get the error below:

The expression is not a node-set. (-->(../my:Numerator div ../my:Denominator * 100) <--| ../my:Numerator ) [(../my:KD_x002d_N_Unit = "Percentage")


Make sure you've got the appropriate spaces between terms. So between any [Field] or any operator (+,*,/), and I think your parenthesis, too?

Your syntax looks correct to me. If the spaces doesn't fix the issue, try making a new field to do the calculation and call it something like NumeratorAsPercent then make your function

( NumeratorAsPercent | Numerator ) [(KD-N_Unit = "Percentage") + 1]
  • Thank you! I attempted to workout the spacing but nothing seemed to work so i ended up the second method you provided and it works! Thank you for the help! – Harry Singh Jan 23 '19 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.