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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cross-tab woes...

Status
Not open for further replies.

fdgsogc

Vendor
Feb 26, 2004
160
CA
I am trying to create a cross tab report. This is what my data looks like.

Question Answer
Question 1 Better
Question 2 Same
Question 3 Worse
Question 4 Better


Here's how it is stored in the database.

ContactID question1 question2 question3
1 Better Same Worse
2 Same Worse Better

This is what I would like my cross tab to look like.

Questions Better Same Worse
question1 1 1 0
question2 0 1 1

Any ideas? I'm using Crystal 9 on Win2k box.
 
Your data example omitted the contactid, and stating that this is how your data looks, and then showing it in the database in a different way contradicts itself.

I think that you'd want a manual crosstab, which means a standard report grouped by the question, with 3 formulas to count the results, as in:

if {table.answer} = "Better" then
1
else
0

if {table.answer} = "Same" then
1
else
0

if {table.answer} = "Worse" then
1
else
0

Now create summaries of these formulas in the group footer in a columnar fashion and I think that you'll have what you want.

You can place the formulas into the detail section, suppress the detail section, right click each formula and select insert summart->sum and select for the group section.

-k
 
Dear FDC,

What happens when you use the Questions field for the row and the answer field for the column and then you would choose the primary key of the table for the summarized value, using a count.

Did it not work?

regards,

ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
Sorry synapsevampire. The first data set is how my survey looks. I will try your manual cross tab. Thanks.
 
How come when I try to format a pivot table, I can only highlight two elements at a time. I am trying to bold and justify my pivot table cells. I am only able to select two fields at a time. What is it with this restriction?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top