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

Need to Sum only one question on a survey of multiple questions. 1

Status
Not open for further replies.

dcsoke

Programmer
Nov 23, 2005
16
GB
This probably sounds like a simple question, but I am new to Crystal Reports and could use all the help I can get, Thanks! I have a stored procedure that is importing a table of data in the following format:

State City Vendor Month Question# Answer
IL Chicago ABC 11/01/05 47 2
IL Chicago ABC 11/01/05 48 1
IL Chicago ABC 11/01/05 49 3
IL Chicago ABC 11/01/05 50 1
IL Chicago ABC 12/01/05 47 3
IL Chicago ABC 12/01/05 48 2
IL Chicago ABC 12/01/05 49 1
IL Chicago ABC 12/01/05 50 3

I have it grouped by State, City, Vendor. I need to show the answer for only question #47 in a list of questions 47-60. What formula can I use to have it display only the answer to question #47 for each month? Any help would be greatly appreciated.
 
right click on the question field and choose insert<running totals

select count on the top option

choose the X-2 button on the middle and add
{table.Question} = 47 where table.question is your table field.

on the reset you choose the group that you want the counter to restart, try by vendor first.

Mo
 
If you want to show all the data but just count the #47s, MisterMo's solution is exactly right. If you only want the #47s, you should be able to make that selection using Report > Select Expert or Report > Selection Formulas > Records. Better to use Select Expert while you're a beginner.

I've done this successfully in Crystal 10. You should give your version: 8, 8.5, 9 etc.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
you're right Madawc I thought he meant count instead of Show.

Must be that early monday morning feeling.....

Mo
 
If you want to show all questions, but only the answer for #47, then create a formula:

if {table.question} = 47 then {table.answer}

Place that in the detail section. If you are summarizing and want to show only the answer to that question in a group section, then insert a maximum on this formula and then suppress the details.

-LB
 
Thanks guys, that really helped out alot!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top