SSRS Report - How to display a specific column value confditionally within a Row Group?

Sahil Monga 26 Reputation points
2022-05-07T18:04:40.527+00:00

Hi Folks,

My SSRS report Dataset (dataset 1) returns the data similar to below:

199894-dataset1.jpg

The report shows the output grouped by the Owner column as shown below. Please help with how can I display (what expression to use) the Oldest Open Case date value (where status = Open) by each team in the last column?

199912-report-output.jpg

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.
3,061 questions
0 comments No comments
{count} votes

Accepted answer
  1. Joyzhao-MSFT 15,631 Reputation points
    2022-05-09T01:56:38.457+00:00

    Hi @Sahil Monga ,
    If you want to get the maximum value of the date, you can use only the Max or Min Function, combined with the IIF Function.

    To get the earliest date with the status "Open", use the expression: =IIF(Fields!Case_Status.Value="Open",Min(Fields!Case_Created_On_Date.Value),Nothing)

    To get the latest date with status "Open", use the expression: =IIF(Fields!Case_Status.Value="Open",Max(Fields!Case_Created_On_Date.Value),Nothing)

    Here is the query data for my dataset:

    199988-image.png

    Design:

    200073-image.png

    Preview:

    199989-image.png

    Best Regards,
    Joy


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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.


2 additional answers

Sort by: Most helpful
  1. Sahil Monga 26 Reputation points
    2022-05-11T13:48:06.227+00:00

    Hi,

    Yes, statecodevalue=0 means Open and Createdon is a date field. I tweaked the expression a little and below worked:

    =Min(iif(Fields!statecodeValue.Value=0,Fields!createdonValue.Value,nothing))

    Actually, my dataset returns the name of teams and users both, to keep it simple I just showed the Team (ownerid) name in the snapshot so my grouping is - iif(Fields!owneridEntityName.Value="team", Fields!ownerid.Value, Fields!alias_team_name.Value)

    Thanks so much for the help @Joyzhao-MSFT !

    1 person found this answer helpful.
    0 comments No comments

  2. Sahil Monga 26 Reputation points
    2022-05-09T14:51:39.733+00:00

    Hi @Joyzhao-MSFT ,

    Thanks so much for your reply. I had actually tried the same before but it shows blank value in my case. Is there anything I am missing:

    Report Design:
    200363-image.png

    Expression:
    200373-image.png

    Output:
    200392-image.png


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.