简体   繁体   中英

Aggregating Total - SSRS 2008 / SQL

I am a new user of SSRS 2008 and SQL in general. Currently I am in the process of creating a report in Reporting Services, however I have a problem in achieving what I would like. These are the 4 columns in my current report:

AU    De    OP       $12

AU    De    FX       $13

EU    De    FX       $6

GBP   Bo    Cor      $8

EU    De    FX       $14

AU    De    FX       $9

GBP   De    FX       $2

..    ..    ..       ..

What I would like to have is be able to aggregate column 3 and 4 by column 2 and 1. Sorry I do not know how to explain it exactly but something like this

AU    De   OP        $12

AU   De   FX        $22  ($13+ $$9)

EU   De   FX        $20  ($6 + $14)

GBP  Bo   Cor       $8

GBP  De   FX        $2

..   ..   ..        ..

I will greatly appreciate any insights anyone can give.

This is a simple group by query:

select col1, col2, sum(col4) as amount
from t
group by col1, col2

You should be able to set this up in SSRS.

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