Counting in Repeating Section - InfoPath Dev
in

InfoPath Dev

Counting in Repeating Section

Last post 08-28-2009 06:51 AM by Laura. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 08-27-2009 12:35 PM

    • Laura
    • Top 500 Contributor
    • Joined on 08-27-2009
    • Posts 27

    Counting in Repeating Section

    Hi, I have a form that has repeating sections and multiple questions within the section.  Users can select as many of these sections as needed.  This has made my form too large and so I would like to be able to just show a count of how many times these questions have been selected/answered.  I only want to display the questions once and then show a count.

    I have tried the count function - count(Fieldname) in an expression box but it only counts 1.  I am using a SQL DB as my xml data source.  I have tried a number of forums but have not had much luck with suggestions.  I would like any solutions anyone would be kind enough to suggest to not involve much back coding as I am unfamiliar with its use.    I appreciate any help.

  • 08-27-2009 10:59 PM In reply to

    Re: Counting in Repeating Section

    i hope your have a check box for selecting the question. put a rule on the checkbox, if the checkbox is selected increment a global variable by 1, if the checkbox is unchecked decrement the global variable by 1. after the user is done, you will have the count in the global variable. (by global variable i mean one that is outside the section )

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 08-28-2009 02:00 AM In reply to

    Re: Counting in Repeating Section

    This is one solution.

    You can too put a default value to a control outside the repeating section.

    You click the "fx" button and you can do the sum of the chechbox control (which taka 0 or 1).

    So, it will sum all the 1 and you will see the number of true response.

    In order to have all the question, you can use the count function.

    Rémi MATAYRON / MVP InfoPath
    Visit my blog : Infopath Blog
  • 08-28-2009 06:51 AM In reply to

    • Laura
    • Top 500 Contributor
    • Joined on 08-27-2009
    • Posts 27

    Re: Counting in Repeating Section

    I seem to have fixed my situation.

    I had to use expression box and XPath as opposed to just the count(FieldName).  Also was able to remove the repeating section and put table in my Opt section

    and it still counted correctly the # of questions from xml source.  Seems logical now that it works, although it didn't earlier.  Thank you for your responses!!

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