SSRS Conditional Sum

  • I am creating an Income Statement for the Accounting Dept. They want some very odd subtotals throughout the report.

    Example:

    GroupName SubGroupName GLDesc Jan 2012 Feb 2012 March 2012

    Sales Tanks P&S 100.00 125.00 75.00

    Sales Tanks P&T 25.00 40.00 30.00

    Subtotal of Tanks Per Month 125.00 165.00 105.00

    Sales Fenders CVO 80.00 100.00 25.00

    Subtotal of Tanks & Fenders 205.00 265.00 130.00

    Sales Misc NCM 25.00 10.00 20.00

    Sales Misc Returns 30.00 10.00 30.00

    Subtotal of Misc 55.00 20.00 50.00

    Sales Total 260.00 285.00 180.00

    So I need to put an expression in for the subtotals so that if its a subcategory of "Fenders" = "Tanks Subtotal + Fenders Subtotal" otherwise total just the individual subgroups("Tanks = tanks subtotal" and "Misc = Misc subtotal"). Currently I have it set up to expand and collapse based on the Group and SubGroup, and I would like to keep it that way if possible.

    I hope all of that makes sense.

    Respectfully,Kate SchwidSoftware Developer/Data AnalystOzaukee, WI

  • I'm not entirely sure this is possible in SSRS. If it is, you'll have a few hoops to jump through to be able to keep the collapsability of the subgroups.

    The only thing I can think of is duplicating the rows to the report, and hiding the ones that come from the 'other section'. However, it'll take me tinkering around with it far too much to figure out how to pull that off. Though, it DOES give me a different idea. If you can send a 'rollup' row of Tanks subtotals to the Fenders Group (and are allowed to display it) that will at least get you the data where you need it to be. Then it's a matter of adjusting visibility.

    On an unrelated side note, your avatar... doesn't look like what it is at first glance. You might want to adjust it unless you're going for that double-take "wtf" response.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

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

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