# Variables and counting records

This topic is 4368 days old. Please don't post here. Open a new topic instead.

## Recommended Posts

I know this is easy for most-but I am struggling. I have a survey with Yes, No, Na check boxes. I want to have FMI count the number of "Yes", count "no" and count "na" while skipping the empty answers for multiple records. I am guessing there is a way to use a variable or global field or something. Right now--I am creating 3 different fields for one question. The actual answer as text (checkboxes). Then a calculation field for giving a numeric value to the answer (if (benefits = "yes";1;0), then summarizing the Total of Benefits.

I know there is an easier way.

##### Share on other sites

More details would be useful. In general, if you sort your answers by question and by answer, you can use a single summary field to count the number of answers in each group.

##### Share on other sites

What I would like to end up with is a Summary page:

Right now I have coded for question 1:

Q1 Text

Q1Scale = If (Q1= "yes"; 1, 0)

Q1RecordCount = Count(Q1Scale)

Q1Total Summary(Number) = Total of Q1Scale(running) **counting yes**

Q1TotalRecord Summary(Number) = Total of (Q1RecordCount) **counting questions that were answered regardless of answer**

Q1Average Calculation(Number) = Q1Total/Q1TotalRecord

This is only giving me the percentage for the yes answers. This just seems so cumbersome to repeat for Q2 then Q3 etc...

##### Share on other sites

How about doing it the simple way?

SummaryReport.zip

##### Share on other sites

This is only giving me the percentage for the yes answers. This just seems so cumbersome to repeat for Q2 then Q3 etc...

That's because there is a basic data structure problem with your approach. You will need to change your design.

The questions should be separate records, not separate fields.

##### Share on other sites

That's because there is a basic data structure problem with your approach. You will need to change your design.

The questions should be separate records, not separate fields.

So to clarify--if I have 40 questions there would be 40 records.

Could you recommend a good instructional manuel or training course.

##### Share on other sites

if I have 40 questions there would be 40 records.

Yes, but what's more important here is that if you have 40 questions and 20 people answering them, there should be 800 individual records in the Answers table.

http://fmforums.com/forum/topic/45972-another-survey-question/

http://fmforums.com/forum/topic/49072-surveys-and-relationships/page__p__229378#entry229378

Edited by comment
##### Share on other sites

Does the attached help? It's a file I found on my hard drive - don't know where it's from...

survey.zip

##### Share on other sites

This topic is 4368 days old. Please don't post here. Open a new topic instead.

## Create an account

Register a new account