experessions in SSRS Reports

Learner 226 Reputation points
2021-10-22T18:19:11.74+00:00

Hello All,

I have a SSRS report where I have 3 columns empname,status and manager.
If the status is approved then I need to show empname as blank and manager name only once.

And for some of the managers some status are approved and some are Rejected then in that case I need to show only rejected status empname and manager name.

Please let me know how to do this.

Below is my data and result

143082-image.png

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,799 questions
0 comments No comments
{count} votes

Accepted answer
  1. Isabellaz-1451 3,616 Reputation points
    2021-10-25T02:47:36.447+00:00

    Hi @vissupangam-0394 ,
    I did a local test,hope will help you.

    with cte as(select  distinct managename from employTest as emp1 where  not exists (select managename from employTest as emp2 where emp1.managename = emp2.managename and empstatus = 'Rejected') )  
      
    select '' as empname,'Approved' as statuss ,* from cte  
    union   
    select employname, empstatus,managename from employTest where empstatus = 'Rejected'  
    

    143158-sceen1.png
    Best Regards,
    Isabella


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful