Preceding Sibling - InfoPath Dev
in

InfoPath Dev

Preceding Sibling

Last post 04-21-2014 08:27 AM by Jimmy. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-17-2014 04:34 AM

    Preceding Sibling

    Hi,

    I have an InfoPath form with a repeating table and I am using the preceding sibling as one of the formulas. When a new row is inserted I want this formula to use the current amount and take it away from the previous amount above it, however the formula only takes away the first amount (first row in the table).

    This is the formula I am using=      . - ../preceding-sibling::my:Main/my:AmountCertifiedForPayment[1]

    I thought that by inserting the [1] it would use the previous amount.

    Have you any suggestions on how to achieve this?

     

    Thanks 

  • 04-21-2014 08:27 AM In reply to

     You need to put the [1] on the preceding-sibling portion, not on the end:

    ../preceding-sibling::my:Main[1]/my:AmountCertifiedForPayment

    The reason you were getting the first value instead of the one you wanted is a little tricky to explain, but putting a [1] after my:AccountCertifiedForPayment is definitely wrong, because it equates to "take the first my:AccountCertifiedForPayment under its respective parent" (and I assume each my:Main only has one my:AccountCertifiedForPayment each).

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.