Running Total (sum according to a criteria)

  • I'm trying to summarize the Total amount according to the type of paycode (IncomeCode, BenefitCode)..

    The IncomeCodes starts with 1 (110, 146 in my example) and the BenefitCodes starts with 5 (540, 560).

    Here is an example of my data

    Employee Code Total

    120000 540 $75.00

    120000 560 $10.00

    120000 110 $1200.00

    120000 146 $45.00

    120000 723 $70.00

    380000 765 $56.00

    380000 110 $985.00

    380000 540 $60.00

    380000 146 $15.00

    I need to setup 2 RunningTotal, one adding up amount for IncomeCode (RunningIncome), the other one for Benefit Codes (RunningBenefit)

    The result of my function should be

    Employee RunningIncome RunningBenefit

    120000 $1245.00 (code 110 + 146) $85.00 (code 540 + 560)

    380000 $1000.00 (code 110 + 146) $60.00 (code 540 + 560 none in this case)

    As an example, in Crystal report, the formula achieving the RunningIncome is setup as below

    Calculate the sum of the Total field only when the value of Code is one of (110, 146), then reset RunningTotal for each Employee

    How can I achieve this in SSRS? The RunningValue function does not seem to be flexible enough to sum according to a criteria (summarize only for code 110 and 146)

    I thought of filtering the codes needed (only getting the IncomeCodes) in the data source query but my problem is that I need to have the other codes in the report as well for my other running total (RunningBenefit)

    Any help would be greatly appreciated. 🙂

Viewing 0 posts

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