How to calculate total Yes responses from an Infopath DDL with choices Yes, No, N/A in a survey questionnaire - InfoPath Dev
in

InfoPath Dev

How to calculate total Yes responses from an Infopath DDL with choices Yes, No, N/A in a survey questionnaire

Last post 02-09-2014 07:26 PM by Sushil. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-07-2014 07:31 PM

    • Sushil
    • Not Ranked
    • Joined on 02-07-2014
    • Posts 2

    How to calculate total Yes responses from an Infopath DDL with choices Yes, No, N/A in a survey questionnaire

    Hi folks,

    I am quite a newbie to InfoPath 2010 designer. I have been asked to generate a questionnaire form and have it published in SharePoint. The form has several sections and each section having several questions with only responses Yes, No, N/A. Later, I have to get total Yes count for each section. I have entered a rule for each textfield QF (question field) to check for Yes and if the condition is met update the SectionTotalField=SectionTotalField+1. Is there a better way to achieve the result?

    Filed under:
  • 02-09-2014 12:51 PM In reply to

    Re: How to calculate total Yes responses from an Infopath DDL with choices Yes, No, N/A in a survey questionnaire

    Hi Sushil,

    Yes, you should use a repeating group node with a question field underneath it and a default value on a totals field (above the repeating group) that calculates the total number of questions answered. You can use the count function that is built into InfoPath with a condition check inside to see if an answer was set.

    To use a repeating group, you will have to add multiple rows and question values to the default values dialog.

    Here's an example xpath that calculates count for all fields in your form:

    count((//*[not(*)] | //@*)[not(name() = "xml:lang")][. != ''])

     

    Patrick Halstead
    Project Manager at Qdabra
  • 02-09-2014 07:26 PM In reply to

    • Sushil
    • Not Ranked
    • Joined on 02-07-2014
    • Posts 2

    Re: How to calculate total Yes responses from an Infopath DDL with choices Yes, No, N/A in a survey questionnaire

     Thanks a lot Patrick. I'll definitely give it a try. I would like to know significance of repeating group node in this. Would the schema be:

    myfields:

       - Group

           -TotalSectionField

                -Repeating Group

                    -group1 

                     -Questionfield1 

                     -Questionfield2 

     

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