Need function to sum Option button totals - InfoPath Dev
in

InfoPath Dev

Need function to sum Option button totals

Last post 06-04-2014 07:38 PM by donstephen. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-04-2014 01:11 PM

    • MattT1
    • Not Ranked
    • Joined on 06-04-2014
    • Posts 1

    Need function to sum Option button totals

    I'm building a form with fields MaterialName, MaterialCost, and 4 option buttons to indicate the MaterialFunding source (MaterialFunding Type1, Type2, Type3 and Type4). I want to calculate the total of each of the types of funding. New to Infopath, I thought this would be an easy SumIf statement, but I'm learning there is no such thing as an Xpath IF statement. If I could use an IF statement this is what it would look like: =SumIF(MaterialFunding, 3,MaterialCost). Can anyone help me write a function that will give me a total for each option. Thanks
  • 06-04-2014 07:38 PM In reply to

    Re: Need function to sum Option button totals

    Hi Matt,

    I understand that you are looking for a formula which adds up the sum of items having a certain type. If you are using a repeating table, then you could use a formula such as:

    sum(field1[field2 = "Type1"]) 

    where field1 is the item and field2 contains the type of item. To add this condition, click the filter button after selecting the desired field, in this case field1, and then select field2 for the frist drop down, select the condition (=), and enter the value desired.

    But if you are working with non-repeating fields, then you should be able to add fields using a formula such as:

    field1 + field2 + field3

    Hope this helps. 

     

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.