sumithnangunuri Posted July 11, 2018 Share Posted July 11, 2018 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 Attendancefrom studentdetails as std,classdate as cdate,curr_attnd_roster atdCreated 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 Persentage1122 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 Persentage1122 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now