Summing up of multiple drop-down values - InfoPath Dev
in

InfoPath Dev

Summing up of multiple drop-down values

Last post 09-24-2012 04:44 PM by adrianodl. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-19-2012 07:32 PM

    Summing up of multiple drop-down values

    Hi all, this is what I'm trying to achieve:

    I have a risk assessment form with determined values assigned to specific yes/no questions, with yes = 1 and no = 0.

    What I want to do is to sum up the values of these multiple drop down boxes and then populate a text box with the result; so for example, if 3 out of 5 answers are yes, the risk is medium. If 5 of 5, it's high, and so on.

     I know how to create the rules based on a a value, but I'm struggling with summing up the different values. I tried to use the sum(field1, field2, field3) function but it tells me the syntax is not right.

     

    Any clues?

     

    Thank you

  • 09-19-2012 11:53 PM In reply to

    Re: Summing up of multiple drop-down values

    adrianodl:
    the sum(field1, field2, field3)
     

    The  description of a sum() function (when inserting it) tells that it has no more than one argument :

    • sum(field)
      Returns the sum of all fields in a field or group.
      Each field is first converted tto a number value

    It would have been strange to have a function that would have required to write many (compare sum(f1, f2) with f1+f2 BLOCKED EXPRESSION 

    Though I failed to get any sane results after applying it to group of Dropdown List Boxes as sum(Group), where Group contains whole number(integer) types of fields, either, having gotten as a result NaN which is weird.

    If you still want to sum the values of of Dropdown List Boxes use field1+field2+field3, having changed "Data type:" of all fields (including the one to which you insert the result) is "Whole Number (Integer)"

    Gennady Vanin (Novosibirsk) --- Геннадий Ванин (Новосибирск)
  • 09-24-2012 04:44 PM In reply to

    Re: Summing up of multiple drop-down values

     Hi Gennady,

    That's right, the field does not support multiple parameters. I actually got it working by doing the simplest thing: field1 + field2 + field3...

    Easy!

    Thanks for your help,

    Adriano

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.