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!

Total % problem 1

Status
Not open for further replies.

savok

Technical User
Jan 11, 2001
303
AT
OK I have a table with 10 rows and 4 fields, Correct, Incorrect, Unanswered and % of Correct

I add up all the correct ones to get a total of correct and do the same for the Incorrect and Unanswered, but when I try to get a % of Correct Totals

(Sum ({@Post_Total_C})) / (Sum ({@Post_Total_C}) + Sum ({@Post_Total_I}) +
Sum ({@Post_Total_U})) * 100

I get an error saying "the summary/running total field could not be created" "This field cannot be summarized"

The strange thing is I use the same formula when I try to get a % of Correct just for the row and it works but when i try to do it for the totals it doesnt work. Any suggestions?
 
Crystal can't sum fields that are or use summary functions. But there may be an alternative:

What is the formula for each of these:

{@Post_Total_C}
{@Post_Total_I}
{@Post_Total_U} Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
its:

(Sum ({@Post_1_C}) + Sum ({@Post_2_C}) + Sum ({@Post_3_C})
+ Sum ({@Post_4_C}) + Sum ({@Post_5_C}) + Sum ({@Post_6_C})
+ Sum ({@Post_7_C}) + Sum ({@Post_8_C}) + Sum ({@Post_9_C})
+ Sum ({@Post_10_C}))

and @Post_1_C etc...adds up all 1s and gives a total of correct

If {pretest2.Correct1} = 1 then
1
else
0

Who ever made the table made a field for Correct, Incorrect and Unanswered, instead of using one field for all three :(
 
{@Post_Total_C} is already a grand total-Sum. You don't need to sum this again in your precentage formula. That is probably also true for the other three. If they are all the same you should be OK with simply:

{@Post_Total_C} %
({@Post_Total_C} + {@Post_Total_I} + {@Post_Total_U})

Using the % instead of the slash does the decimal point for you. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Thank you very much, it helped! If you got time can you please look into my post about Deleting or refreshing tables from Visual Linking expert?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top