Help with totalling results of checkbox - InfoPath Dev
in

InfoPath Dev

Help with totalling results of checkbox

Last post 01-22-2007 12:30 PM by Shiraz Cupala. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-18-2007 03:10 AM

    • Bruum
    • Not Ranked
    • Joined on 01-18-2007
    • New Zealand
    • Posts 2

    Help with totalling results of checkbox

    I am a newby to Infopath - and am creating an advertising budget form. Everything is going well so far - but now I need to total some repeating columns and I am getting stuck.

    I have a XML datasource with ID/AdvertPub/AdvertBook/AdvertCosts which fill a repeating table as follows :

    Drop down box selects AdvertPub, which then autofills AdvertCosts and AdvertBook, then user clicks on 1 of 3 checkboxes - Vendor, Agent or Office to pay.

    In the footer I have a total of AdvertCosts which is working fine. But now I need a vendor total - ie: when the vendor total is ticked (which is not all the time), the vendtotal box should add up all associated Advertcosts for that line.

    I can get this to work in Excel and Access but can't figure it out in Infopath. Would appreciate anyone's urgent assistance. Note I am not to good with code, but can work through the rules OK.
  • 01-19-2007 01:41 AM In reply to

    Re: Help with totalling results of checkbox

    Hi Bruum and welcome to the forums,

    Apply rule on the vendortotal field defining a function to display the total.

    Hope this helps you!
    Shilpa
    INFOPATHDEV India
  • 01-19-2007 12:41 PM In reply to

    • Bruum
    • Not Ranked
    • Joined on 01-18-2007
    • New Zealand
    • Posts 2

    Re: Help with totalling results of checkbox

    Thanks Shilpa

    Problem is I can't get the code right that goes in this rule. Are you able to help me here?
  • 01-22-2007 12:30 PM In reply to

    Re: Help with totalling results of checkbox

    Welcome to our forum Bruum. This requires some tricky XPATH to get it to work. What you need to do is have the formula filter our only the repeating node where the Vendor node is true. The exact xpath will depend on your XML structure.

    You have the example of the advertcosts xpath. Can you also give the example of the xpath to the vendor checkbox node?

    Also which is the repeating node above?

    Your formula would be be something like:
    sum(/ID/AdvertPub/AdvertBook/AdvertCosts[Vendor=true])

    The formula builder UI should allow you to build this graphically by dropping in the sum formula and then specifying the node to sum but then applying a filter to that node. The filter button will be on the dialog where you select the node for the sum(doubleclicktoselect) formula.

    Thanks, Shiraz
    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.