Formula for Statistic In CR

harry_usj
01-14-2004, 04:18 AM
I have a question about crystal report formula...

the situation :
I already extract information for all student in this semester from my database. The student is in different kind of programme (Diploma, Degree, PHD)

TABLE STUDENT :
-Name
-StudentNo
-Sex
-Programme



So i already can list all the student grouping with the programme.

My question is....

1. How do i create a formula so i can display a statistic information for displaying the total of Diploma Male, Diploma Female, Degree Male, Degree Female and so on...?

any example how to count it using formula?

thanks a lot for the information.

regards,
harry

KnooKie
01-14-2004, 04:29 AM
What database you using ?


SELECT
Name
StudentNo
Sex
Programme
Count(Name) as StudentCount
FROM
Student
Group By
Name
WHERE
Sex = "male"
AND
Programme = "PhD"


You can pass in the sex and programme to make it more dynamic.

harry_usj
01-14-2004, 04:51 AM
Hi,

I'm Using SQL Server,

Actually i'm trying to display using crystal report, not using any VB, because the VB part is ok. i already connect to the database.

i just don't know how to use the Formula Editor to display the total for each of the programme and Sex...

how do i do that? any example using Formula Editor in Crystal Report?


Thanks for the reply...

harry

MKoslof
01-14-2004, 06:31 AM
No, no, no that is VB format. This actually has nothing to do with VB, but I am willing to help you :).

Do you need to add up specific fields while printing records? Do you have experience with creating formulas? Basically, it looks like you want a formula for a running total, correct? Do you want a running total of all diplomas? Can you map out what fields need to be in this formula (what needs to be compared) and what final output you need (etc: based on fielda and fieldb I need to get the total of this field..etc.)

Let me know, and I will try to get you started

harry_usj
01-14-2004, 05:22 PM
Hi everyone,


I have STUDENT table with this colum

TABLE STUDENT :
-Name
-StudentNo
-Sex (value : M,F)
-Programme (Value : Diploma, Degree, PHD)


what i want to do is, to calculate the formula total for

1.Diploma Male
2.Diploma Female
3.Degree Male
4.Degree Female
and so on...

i already group it by the PROGRAMME and it show the total student for each of the programme.

now how do i break it, into male and female?

thanks for the reply....


harry

harry_usj
01-14-2004, 06:48 PM
In the crystal report :

the SQL Query : Select * from STUDENT

the selection for total
Diploma/Male : Sex="M" and Programme="DIploma"


i just don't know how to count it using formula... if i want to count only total student for each programme, i can just group by Programme and get the total group. since i have to break it to F and M, so i'm stuck at that point right now....


thanks for the reply

MKoslof
01-15-2004, 06:42 AM
"Diploma/Male : Sex="M" and Programme="DIploma"


i just don't know how to count it using formula... if i want to count only total student for each programme, i can just group by Programme and get the total group. since i have to break it to F and M, so i'm stuck at that point right now...."


OK, so do you have a Gender(sex) FIELD and a Program FIELD? This is still not clear. If not what fields do we need to search for in order to find this information.

Basically we want to count all instances where the gender is "M" and the program is "Diploma". So, let me know if these are two valid fields, or if this information needs to pulled from a different field such as in the "Development" field I need to search all records and find the string "Diploma". Or is there a specific "Program" field that only holds certain values such as "college degree, diploma, work", etc.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum