Joined: 03 Feb 2010
Location: South Africa
Online Status: Offline
Posts: 3
Topic: Cross tab averages Posted: 03 Feb 2010 at 11:00am
Hi Guys.
I have a report in Crystal 2008
Im using a cross tab to display students with there marks.
on the end i have a SUM of all the marks and a average.
but where the trick comes in the mark is returned from the stored procedure as a string, because if a student did not write an exam it must display 'xx' instead of a '0' or '45' or whatever the mark may be.
so i created a formula field with the folowing code:
/////////////////////////////////////////////////////////// Local NumberVar MarkInt;
If NumericText({sp_Register_Reports;1.Mark}) Then ToNumber({sp_Register_Reports;1.Mark});
example there is supposed to print 21 guys on a list. and their marks sum up to be 627, but 2 of those students did not write exam it throws the average out.
now : 627 / 21 = 30 should be : 627 / 19 = 33
How can i tell the avg to only COUNT the students that has a mark and not an 'xx' to use for the avg?
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Posted: 03 Feb 2010 at 12:50pm
You would need to create your own counter (running total?) and have the formula 'NumericText({sp_Register_Reports;1.Mark})' for the Evaluate condition.
Joined: 03 Feb 2010
Location: South Africa
Online Status: Offline
Posts: 3
Posted: 03 Feb 2010 at 9:46pm
Originally posted by kevlray
You would need to create your own counter (running total?) and have the formula 'NumericText({sp_Register_Reports;1.Mark})' for the Evaluate condition.
That should give you a true count.
Thanks but how do I tell the average on the cross tab to take that running total field in to the calculation?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum