## Running Total (sum according to a criteria)

 Author Message Zaza SSC Rookie Group: General Forum Members Points: 27 Visits: 39 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 dataEmployee Code Total120000 540 \$75.00120000 560 \$10.00120000 110 \$1200.00120000 146 \$45.00 120000 723 \$70.00380000 765 \$56.00380000 110 \$985.00380000 540 \$60.00380000 146 \$15.00I 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 beEmployee RunningIncome RunningBenefit120000 \$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 belowCalculate 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. :-)