Solved

Crystal Reports problem

Posted on 1998-12-21
5
219 Views
Last Modified: 2010-05-03
Hello everybody I have the following report that I have to create, but I don't know how I would go about doing it within Crystal.

What I want to do is display the seq_no and quest_text from a table called audit_detail on the left hand column.  This will go in order seq_no 1 through whatever and the corresponding text.  It is kinda difficult to explain with words  what I want on the right hand side, but I'll show you an example.

Left Side                           Right Side
1 Authorized POG Dealer             1  89.3%
                                    2  10.7%

2 # of clipstrips                   0  90.7%
                                    1  5.3%
                                    2  4.0%

etc.                                

Know what the above shows is how many people answered question 1 with a response of 1, 2 in the first question and 0, 1, 2 in the second question.  This information is display in the answer_detl table in a field called answer there is also a seq_no in this table which links back to the original table.  There is one more table called answer_header which contain a field called survey_code (there is also a survey_code in the orginal table that is linked to this).  This table is linked to answer_detl by a field called answer_key.  

I do not know how to go about listing each answer that was given for each question and the finding the total percent
0
Comment
Question by:Jagar
  • 3
  • 2
5 Comments
 
LVL 18

Accepted Solution

by:
mdougan earned 150 total points
ID: 1451797
This is not a simple question to answer but here goes:

When you create the report with the standard report wizard, you'll want to make sure to group by seq_no.  Hide the Group header for this group and hide the detail line as well.  So, all you are showing is the Group Footer for the seq_no group.  In that footer you can list the percentages for each answer using calculated fields.  The calculated fields will have formulas that count the number of detail lines with each type of response and divide by a count of the total detail lines.

Now, if the number of possible respones vary for each question, and you want to do all of this dynamically, then you'll have to get fancy with the query that you use to populate the report.  Namely, you'll want to do all of your summation in the query.  Let me know if you have no idea of what all of this means!

MD

0
 
LVL 2

Author Comment

by:Jagar
ID: 1451798
I have sum idea what it mean, but am not really clear on how to do it.  If you could provide an example that would be great, but your right what you says makes since and should probably come close to working.  If you could provide the example that would be great.
0
 
LVL 18

Expert Comment

by:mdougan
ID: 1451799
OK, lets say that you create a query that joins the audit_detail table and the answer_detl table on seq_no.  The result would look like:

seq_no  quest_text                       answer_no  answer_key
1       Authorized POG Dealer            1          555
1       Authorized POG Dealer            1          324
1       Authorized POG Dealer            2          123
2       # of clipstrips                  0          442
2       # of clipstrips                  0          211    
2       # of clipstrips                  1          776    
2       # of clipstrips                  2          343

When you run the report wizard, tell it to group by seq_no so that the records will break inbetween seq_no 1 and seq_no 2, to give you a place to show your totals.  Again, hide the group header and the detail line.  In the footer place a few calculated fields.  

For example, you could create one calculated field called TotalResponses whose formula would look something like:
count({answer_key})

To count each response you could have three calculated fields for each possible response:

CheckAnswer1 - if {answer_no} = 1 then 1 else 0
SumAnswer1   - sum(CheckAnswer1)
Answer1Pct   - if TotalResponses > 0 then
                  SumAnswer1/TotalResponses
               else
                  0

The only fields you would actually show on your Group Footer would be Answer1Pct and TotalResponses.  You would have to create "Answer1"-like calculated fields for the largest number of possible answers.  So, if you have one question with 5 answers, then you'll need to create Answer1-Answer5 calculated fields.  You can check the property for these to be "blank if zero", so, if a question has less than 5 answers, say 3 answers, then answers 4 & 5 will be zero (because no one could have given those answers).  So, they will not print.

This is just one approach to your report, and not a very dynamic one at that.  Again, there may be other, better, ways to do it but hopefully, this will point you in the right direction.  Unfortunately, it's about all I can do in this forum, since I can't look over your shoulder as you work with Crystal.

MD

   
0
 
LVL 2

Author Comment

by:Jagar
ID: 1451800
I started to play with these ideas and have made some progress.  I play with these additional ideas.  I will give you the points, but I'm going to try and finish the report first, so that maybe you can provide additional help (hopefully won't need any).
0
 
LVL 2

Author Comment

by:Jagar
ID: 1451801
Thank You

You led me in the right direction and I used something a little different, but along the same ideas.


0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question