Search code examples
reporting-servicesssrs-2008ssrs-2008-r2reportingservices-2005ssrs-tablix

Running subreport ONLY on max of a group


I have a subreport in a tablix that I only want to run if the row has the maximum due date of a grouping. The grouping I have is by part #.

Basically, if a row has the latest due date for that part #, I want the subreport to run/show.

I tried this for the hidden expression on the subreport, but it has some errors (too many arguments):

=IIF(Fields!DUE_DATE.Value = max(Fields!DUE_DATE.Value, "PART_NO"), "PurchasePart", False, True)

Any ideas?


Solution

  • Try this expression:

    =IIF(Fields!DUE_DATE.Value = max(Fields!DUE_DATE.Value, "PART_NO"), False, True)
    

    Note IIF function receives three arguments, you have an additional argument in your expression: "PurchasePart".

    =IIF(conditional,true branch,false branch)
    

    Let me know if you need further help.