Returning Students Position in the class using SSRS
Hello all, i am designing a Business Intelligence solution using SSRS that would show students result. I want to design the solution such that the report will have a column that will display each student's position in their respective classes based on the average score for the term. For instance, Student Name Average Score Class Position Adam Smith 99 1st Henshaw King 50 4th Thelma Eva 72 2nd Queen Essell 64 3rd..........etc Please i need a response ASAP Thanks.me
May 24th, 2012 5:20am

Hi There You just need to sort your data in descending order or your average score on the table level and give the your third column expression =RowNumber(nothing) and it will look like this screenshot and then you can format it according to you need --your position column expression =RowNumber(nothing) Many Thanks Syed Qazafi Anjum Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.
Free Windows Admin Tool Kit Click here and download it now
May 24th, 2012 5:55am

Thanks dear, this is lovely but i was thinking if you make it be in the nth format (1st, 2nd and 3rd) Thanks anywaysme
May 24th, 2012 6:12am

Just add =RowNumber(Nothing) & IIF(RowNumber(Nothing)=1, "st", IIF(RowNumber(Nothing)=2, "nd", "rd"))
Free Windows Admin Tool Kit Click here and download it now
May 24th, 2012 6:28am

Hi There you can either use Ursa suggestion or you can write custom code inside SSRS like this =code.ConvertNum(RowNumber(nothing)) Public Function ConvertNum(sNum as String) as String Select Case sNum Case "1", "21", "31" sNum = sNum & "st " Case "2","22" sNum = sNum & "nd " Case "3", "23" sNum = sNum & "rd " Case Else sNum = sNum & "th " End Select return sNum End Function and you can call like that =code.ConvertNum(RowNumber(nothing)) I hope this will help many thanks Syed
May 24th, 2012 6:55am

Thanks dear me
Free Windows Admin Tool Kit Click here and download it now
May 24th, 2012 8:17am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics