简体   繁体   中英

Set a group's value based on a aggregation of all the records inside it in SSRS

I have got this situation in report builder for SSRS where I would like to add a column for each Company with a Complete/Not complete label as follow:

If all the records for a CompanyId is "Complete" then the group's label (Company status) should state 'Complete', otherwise, if even one of the records has other labels than "Complete", then the group's label (Company status) should state "Not complete". How would you approach this in SSRS table/matrix design?

在此处输入图片说明

Assuming you have a group on companyid you can just use some conditional aggregation on the value in the Status column:

=iif(sum(iif(Fields!Status.Value <> "Complete"
            ,1
            ,0
            )
        ) > 0
    ,"Not Complete"
    ,"Complete"
    )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM