Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have a problem where I would like to add a calculated field in SSRS report to extract the all lowest values from the table and list in the newly added calculated field.

Details:

Table Employee
Name Dept. Sal        
"GP"	"IT"	50000
"HP"	"IT"	60000
"AB"	"IT"	70000
"LP"	"IT"	50000
"MP"	"HR"	50000
"XP"	"HR"	40000
"WP"	"HR"	40000
"VP"	"HR"	70000


What I have tried:

In Sql I'm able to get the desired result like:
select *,
case when (rank() over(partition by dept order by sal))=1 then 'Lowest' end
from employee


However, I couldn't figure our how the similar logic can be added in SSRS report's calculated field.
Please advise.
Posted
Updated 11-Jan-22 22:36pm

1 solution

Create a view of the table and do your processing there
 
Share this answer
 
Comments
PreetMDX 13-Jan-22 0:26am    
Thanks @pkfox

This is working with a view,

Does this mean this can not be done in SSRS as a calculated field or if I would need to highlight the lowest value against Dept as conditional formatting?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900