How to count non blank fields in Infopath forms? - InfoPath Dev
in

InfoPath Dev

How to count non blank fields in Infopath forms?

Last post 02-28-2012 08:18 AM by TSKoo. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 07-12-2010 04:26 AM

    How to count non blank fields in Infopath forms?

    Hi,

           I have 7 individual fields for keeping track of different rates which will only take values from 1 to 5, I need to sum up the 7 fields and to find the average, the challenge is that not all fields are fill up, therefore I need to know how many fields are not blank, I tried to create a new group and moved all the above 7 fields under this new group and used the Count function but it returns "1" which is not correct. I tried Count (field 1) + .... for seven times but this returns a fix value of 7.

     Appreciate if you can assist me, thanks.

    Filed under: , ,
  • 07-12-2010 04:54 AM In reply to

    Re: How to count non blank fields in Infopath forms?

    count((field1 | field2 | field3 | ...)[. != ''])

    If the fields are in a repeating structure:

    count(repeatingField[fieldToCount != ''])

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 07-12-2010 06:30 AM In reply to

    Re: How to count non blank fields in Infopath forms?

    Thanks Jimmy for the quick answer, it works

  • 05-09-2011 09:03 AM In reply to

    • B1rds
    • Not Ranked
    • Joined on 03-24-2011
    • Posts 10

    Re: How to count non blank fields in Infopath forms?

     

    Hi Jimmy,

    I have a similar but slightly different probem I have a Group and I have a subset of yes/No fields within that group. My probem long term is that I will have 10 groups and each group will have 5 fields and I want to find a way to count the fields via the group. Hope this makes sense

    Thanks

    Mike

  • 02-28-2012 08:18 AM In reply to

    • TSKoo
    • Not Ranked
    • Joined on 02-28-2012
    • Posts 3

    Re: How to count non blank fields in Infopath forms?

    Jimmy,

    I need to count a field which will have different values.  For example. the value in field paymentstatus.code can be  'ISSUED' or 'FORMATTED'.  Can you tell me the syntax on OR?  

    I tried the below statements but it did not work.

    <?count(PaymentStatus[Code='ISSUED'||Code='FORMATTED'])?>

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