hi,
I want to calculate number of presents,absents and over all present persentage.
I had started creating a report using cross tab,need to perform the calculations for number of presents,absents and present persentage.
My sample query is like,
select std.rollno,std.studentname,cdate.classdate,atd.curr_attnd_roster_attendance,
CASE
WHEN atd.curr_attnd_roster_attendance = 'Present' THEN 'P'
WHEN atd.curr_attnd_roster_attendance = 'Absent' THEN 'A'
ELSE 'unknown'
END AS Attendance
from studentdetails as std,classdate as cdate,curr_attnd_roster atd
Created a report using crosstab and got strucked in counting the number of presents,absents.
Variables I have used to create a below report,
$V{rollno},$V{studentname},$V{classdate},$V{attedance}
Sample data displays as,
Rollno StudentName 05/03 06/03 07/03 08/03 09/03 Presents Absents Persentage
1122 Raghu P P A P A ? ? ?
1123 Suresh A A P P P ? ? ?
1124 Rajesh P P A A A ? ? ?
What I need is,
Rollno StudentName 05/03 06/03 07/03 08/03 09/03 Presents Absents Persentage
1122 Raghu P P A P A 3 2 60%
1123 Suresh A A P P P 3 2 60%
1124 Rajesh P P A A A 2 3 40%
Guys please help me as I am finding difficult to perform calculation where I need to count the number of presents,absents and present persentage.
To perform the calculation I need to know what are the variable should I create , what are the variable expressions should I write and how to use those variables to make my need satisfy.
Please help me in sharing the procedure for performing the count values and persentage calculation.
Thank's in advance.