1

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

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

Else{Numerator}

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")

1 Answer 1

1

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]
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! Commented Jan 23, 2019 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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