Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Want to list results of Question1 for all records, then Question2

Status
Not open for further replies.

Frogponder

Programmer
Apr 1, 2003
2
CA
I have a database of 20 answers (from 20 questions) for about 300 people. Some are narrative (answer in written format), other answers are true/false, while still others are number counts.
I want a report to display question 1 along with all it's answers then display question 2 along with all it's answers, then question 3 along with all it's answers.

I don't even know where to start this summary of questions.

I already have a report done for one person's answers, but not everyone's answers in one report.

I've done basic reports like membership, address listings, etc., but nothing like this.

Please help
 
It should not be too difficult...just a little planning required.

You must describe your database to us.

But I am going to assume that your report will look something like

*****************************************************************
Question 1 How do I make this report work?

Responses
1. With great difficulty...
2. No Problem...get help from Tek-Tips
...................

Question 2 ......................?

Responses
1. ..................
*********************************************************************
So...the report will be grouped on the Question field first and then the person who reponds second...this is pretty straight forward.

What is not clear is the nature of the fields that compose the answer....and this is the tricky part. You say the answers can be numeric, written and true/false

Are these separate fields in each person's record...ie. is only one field populated...something like

Reponse record

Person's name | Boolean response | written response | numeric response

It would be nice if there was something in the record that would show which type of response it is...it is not necessary but would make life easier.

If it were written then you probably would just list every response as is with no summary.

If it were True/False you would probably count the number of True and False responses and put the totals down.

If it was numeric you would probably summarize the number of times each number came up (similar to True/false but expanded)

This can all be done in one formula with the results converted to strings at the end for printing purposes

More details and a sample of what you are looking for as a result is required....hopefully I have given you some ideas but the Report look is up to you. Jim Broadbent
 
Yes, there are many answers per record. But I don't have the questions in the database, just the answers.

I would like to have the report look like:

Question 1 - Answers from everyone
1. answer 1 from boss
2. answer 2 from secretary
3. answer 3 from staff A

Question 2 - TRUE/FALSE answers from everyone
count of true count of false
average of true average of false

Question 3 - Total hours for everyone
total hours
average hours

etc. for each Question



Again I have all answers in database, many answers for 1 record (meaning for 1 person) .

I have a person ID, with all fields as answers in one record. But the question is not in the database.

Thank you both for your help so far.



 
Group the report by the answer number.

Now create a formula which has something like:

Case {table.answerNo}
when 1 then
"Question 1 - Answers from everyone"
when 2 then
"Question 2 - TRUE/FALSE answers from everyone"
etc...
End

This will handle the Answer text, so display this in the group header.

As for just listing out the text "answer 1 from boss" in the details section, use something like the following in a formula:

"Answer " +totext({table.answerNo},0)+ " from " + {table.name}

This is all loosely defined, the way to get better answers is to supply example data, and expected output. It also helps to supply Crystal version and database and version.

-k
 
If each answer is its own field, and the report returns only one row per respondent, then you could create the report in the report header.

For each question, create a text box and enter the question text, and for categories of responses also create a text box that identifies the type of response. Then place your summaries next to the text box. For example,

Question 1: I believe it is essential for employees to work 60 hours per week. (T/F)

True: 1
False: 512

Create two formulas {@true} and {@false}, place in details section, and suppress:
if {Ans1} = "T" then 1 else 0
if {Ans1} = "F" then 1 else 0

Right click on each formula and insert a sum and drag to the report header and place next to appropriate text box.

Question 2: How many hours do you think employees should work per week?

Average: 22 //Right click on {ans2},insert average, and drag to header.

Question 3: How many hours do each of the following categories believe employees should work per week?

Boss: 60 //sum of {@boss}: if {employeeposition} = "Boss" then {ans3} else 0
Secretaries: 22 //sum of {@secy}: if {employeeposition} = "Secretary" then {ans3} else 0
Managers: 22 //etc.

For the narrative questions, I think you might have to add a subreport for each question in order to display all answers for one, then all answers for the next, etc. Each subreport would display only one {ans} in the details section along with any other fields you might want to sort by, e.g., {employeestatus}.

Question 4: Explain why.

{employeestatus} {ans4}//which reads:

Boss: "For the good of the company"
Secretary: "That's the most anyone should work"
"So I can work at my second job"
Managers: "For the good of the company"
"That's the most I should work"

If you wanted to avoid subreports, the automatic display of the detail section might work well enough for you, but would have a cross tab look to it. You would need to suppress all but the narrative fields and other fields of interest, and check "Can grow" to format each answer field. You could sort or group by {employeestatus} if you want and suppress if duplicated. Place your text questions as column headings:
Question 4 Question 5 Question 8
Boss "xxx xxxx" "xxx xxxx" "xxx xxxx"
Secretary "xxxx xxxxx" "xxxx xxxxx" "xxxx xxxxx"
"x xxxx" "xx xxxx" "x xxxxx"
Manager "xxxx xxxxx" "xxxx xxxxx" "xxxx xxxxx"
"x xxxx" "xx xxxx" "x xxxxx"

-LB

 
Since each record containd multiple answer fields, and since each question requires a different display of information I recommend you do the following:

1. Create a report showing the information for Question 1.

2. Insert 9 more Report Footer sections to create RFa, b, c, d, e, f,...j

3 Insert in each of these report footers a subreport showing the information for a diffeernt question.

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
shouldn't grouping on the question number give the desired results?

Transcend
[gorgeous]
 
surely you have some way in your answer table of knowing
which answers belong to which questions?

Transcend
[gorgeous]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top