percent of total expression in Report Builder 2

  • Hi all.

    I'd really appreciate some help with Report Builder. As seen in the attachment, I have a report that shows the weight of materials. In my sql query I have used a case statement to tag some of the materials with a y or a n.

    What I want to do is add a calculated cell that sums all the values of the materials tagged with y and divide by the total and * 100 to find the percent of the rows tagged y of the total amount.

    I'm new to report builder so please let me know if this doesn't make sense.

    Many thanks.

  • Hi all.

    Does anyone have any idea..I'm really struggling with this

    Thanks.

  • Okay, I guess I'll bite...

    Can you post some consumable data? here's one way to do it:

    SELECT "Glass" AS ItemType ,109.52 AS Weight

    UNION ALL

    SELECT "Cardboard",55.86

    UNION ALL

    SELECT "Wood",150.54

    UNION ALL

    SELECT "Metals",31.89

    Jeff Moden posted a really nice article explaining how to do it. Definitely worth a read, or two... or until you get good answers. http://www.sqlservercentral.com/articles/Best+Practices/61537/

    Then we can help you. But we can't fix what we can't see.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply