Jump to content
We've recently updated our Privacy Statement, available here ×

Count Number of presents,Number of Absents and overall present percentage.


sumithnangunuri

Recommended Posts

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.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...