Count non-blank fields and also find lowest number in list - InfoPath Dev
in

InfoPath Dev

Count non-blank fields and also find lowest number in list

Last post 01-19-2012 09:34 AM by Anson Hidajat. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 01-17-2012 01:32 PM

    Count non-blank fields and also find lowest number in list

    I'm looking for two different numbers for my form to calculate.  the form is a quality form for users to click 97 rows of quality questions and in each row they need to select a check box either for N/A, OK or Error.  If the Error check box is checked a value (1, 2 or 3) is added to a field to the far right (I completed this part).  This will be done to all 97 rows of quality questions.I need to know1.      What is the lowest number entered in column (in the far right column)2.     How many fields have a number entered – number of non-blank fields (in the far right column)

    I am using Infopath 2007

    thank you!

     Vicki

  • 01-17-2012 01:50 PM In reply to

    Re: Count non-blank fields and also find lowest number in list

    Hi Vicki,

    The best way to do this is to have the data for each of those questions be in a repeating field.  Then you could use the functions in InfoPath such as min(), max(), sum(), etc. to do your calculations.

    If you're constrained to your current data source/schema, you'll need lots of rules and maybe a few temp variables to accomplish what you want.  I would recommend the repeating approach since that will make things neater for you.

    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 01-17-2012 02:14 PM In reply to

    Re: Count non-blank fields and also find lowest number in list

    Thank you Anson.  Being a newbie, I think I need to review how to do repeating fields.  Do you have a link that would show me how to do this in my situation?  thank you again!!

  • 01-17-2012 02:23 PM In reply to

    Re: Count non-blank fields and also find lowest number in list

    Sure!  Here is an article describing how to sum a column in a repeating table: http://office.microsoft.com/en-us/infopath-help/sum-a-column-of-numbers-in-a-repeating-table-HP010081939.aspx

    You'll want to use the min() function in your case.

    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 01-18-2012 12:59 PM In reply to

    Re: Count non-blank fields and also find lowest number in list

     I would like to ask for some further help.

    I looked at the instructions you sent me and also search the internet for more info on adding a repeating table.  When adding a repeating table it only gives me one row and as many columns as I need.  I'm pasting in this message below what I orginally came up with and I would like to know how to create this with a repeating table.  Its seems from what I've read in the link you gave me that the end user would add more rows but I want to set up the form with the rows already there as each row has a row header.  The last field which you can't see (6th column) is populated if the  Error check box is checked in any row, the number in the 5 column is just a placeholder for the user to know what that error would be worth.  I hope I'm explaining myself and my confusion. Thank you once again!

     Please see below:

     
    N/A
    OK
    Error
     
     
    A/G/C Function
    Field 2
    Field 3
    Field 6
    2
    Gen Date
    Field 4
    Field 5
    Field 7
    2
    Name/Address
    Field 8
    Field 9
    Field 10
    2
    Option Position 1
    Field 11
    Field 12
    Field 13
    2
    Group Type
    Field 14
    Field 15
    Field 16
    2
    Contract Situs
    Field 17
    Field 18
    Field 19
    2
    Admin Type
    Field 20
    Field 21
    Field 22
    2
    Age Change Code
    Field 23
    Field 24
    Field 25
    2
    Policy Effective Date
    Field 26
    Field 27
    Field 28
    1
    Anniversary
    Field 29
    Field 30
    Field 31
    2
    Other Policies
    Field 32
    Field 33
    Field 34
    3
    INS Type
    Field 35
    Field 36
    Field 37
    3

  • 01-19-2012 09:34 AM In reply to

    Re: Count non-blank fields and also find lowest number in list

    Sounds like repeating tables aren't the way to go for your solution :)  You can still do what you want with rules, but will require a more leg work on your part.

    Count of non-blank fields

    • You could do this one of two ways:
      • Create a variable for the count and set default value to 0.  Then for each of the option fields, create a rule that says if value changed then set a field's value count = count + 1 OR
      • For each of your Error fields, if you had these all set to 1 you could simply add up all these fields to get your count.

    Lowest number

    • This one is a little trickier.  One method I thought of is to create a temp string variable.  Then concat all of the values into this one variable each time one of the option value changes.  Then you can do create rules to try and find '1'.  If that fails then find '2', and so forth.  There's probably a better way of doing this, but this is the best I came up with right now :)

    Please take my suggestions lightly since I didn't actually try any of these out in practice.  They just work based on what I'm thinking in my head :)  But hopefully it will get you started and on the right track.  Good luck!

    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

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