Solved

How to sum a formula field

Posted on 2003-11-12
9
1,875 Views
Last Modified: 2011-04-14
I am trying to sum a formula field.  I have a formula called I/D and it uses an if statement to to see if a pre-test grade is higher than the post test.  If it is higher, it gives it a 1 else 0.  The sum is having problems with the I/D field saying 'A number field or currency amount field is required here.'  Any idea's would help very much.
0
Comment
Question by:a23m2000
  • 5
  • 4
9 Comments
 
LVL 42

Expert Comment

by:frodoman
Comment Utility
Sounds like a problem with your formula.  It should look like this:

If {Pre-Test} > {Post-Test} Then
   1
Else
   0

And both pre-test and post-test must be numeric values, of course.  If there are null values in either pre or post that will cause you a problem also.

If this doesn't help, please post your I/D formula.
0
 
LVL 42

Expert Comment

by:frodoman
Comment Utility
By the way, if you do have null values you'd address it this way:

If isnull({Pre-Test}) or isnull({Post-Test}) Then
   0
Else if {Pre-Test} > {Post-Test} Then
   1
Else
   0
0
 

Author Comment

by:a23m2000
Comment Utility
There isn't a problem with the I/D field in itself it spits out the number 1 or 0 based upon the >< of the grades...where I am running into problems is when I am trying to create another field to sum the I/D field....example...

                Pretest         Posttest        I/D
Student 1       50              45              0
Student 2       50              95              1
Student 3       50              45              0

Class Average:  50              62



# of participants increasing score              2                <------------------ This is where I am having the problem.
# of participants decreasing score      1                       <------------------ Here as well.


So the I/D field is good, however when I try and create a formula for the # of participants increasing and decreasing I have the problem.  Hopefully this helps clarify the problem.

Sum ({@I/D}) is what I'm doing for the # of participants increasing score.  However I get the error 'A number field or currency amount field is required here.'
0
 
LVL 42

Expert Comment

by:frodoman
Comment Utility
I understand what you're saying but I suspect that the number you're seeing in the I/D column isn't really a number...  

If I create a summary formula as: Sum ({@I/D}) I get the correct result.  You're being told that a number is required here which means that your formula I/D does not always return a number.  Most likely it is either returning a text "1" or "0" or is sometimes returning a null value.

Please post your I/D formula and I'll take a look.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:a23m2000
Comment Utility
If {COURSE_HISTORIES.rt_ch_grade} > {COURSE_HISTORIES.rt_ch_test} then '1' else '0'

I see what you are saying about the text part, I am looking at it now.
0
 
LVL 42

Expert Comment

by:frodoman
Comment Utility
Just take the single-quotes off your formula & you should be fine:

   If {COURSE_HISTORIES.rt_ch_grade} > {COURSE_HISTORIES.rt_ch_test} then 1 else 0

0
 

Author Comment

by:a23m2000
Comment Utility
great that does it...one more question...on the I/D field there are 1's and 0's and can I use a formula or summary to find the number of particiants decreasing score, or the number of 0's on the I/D field....thanks...I will award you the points after this question...

thanks again for you help
0
 
LVL 42

Accepted Solution

by:
frodoman earned 500 total points
Comment Utility
Easiest answer based on what you have is another formula:

count({@I/D}) - sum({@I/D})

This just counts the entries and subtracts the sum (which is the same as subtracting the number of '1's).

If you want to get more adventurous, you can look into using 'count' with conditions.  

Another option would be to have another version of your I/D field with the reversed criteria (so the 1's & 0's are reversed) and just create another sum on those.

I'd go with the formula above in this case, but remember the other options for another time when you have more than 2 possible outcomes...
0
 

Author Comment

by:a23m2000
Comment Utility
Hey I really appriciate your help, I will award your points, thanks again buddy
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

728 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now