Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Sum,grouping

Author  Topic 

zhshqzyc
Posting Yak Master

240 Posts

Posted - 2008-12-05 : 22:26:12
Hello,
In my rdlc report there is a table from a stored procedure.
Type        Amount           Total
Cash 200 2000
Cash 250 2000
Cash 200 2000
Cash 150 2000
Cash 200 2000
Cash 1000 2000
Credit 50 600
Credit 150 600
Credit 400 600

This table is designed silly because of the third column.
To hide it, now I am going to diaplay the total values in another table.
It should be
Type      Total
Cash 2000
Credit 600

I guess the function of sum(Fields!xx.Value) may be used but I don't know it exactly.
Would you please tell me a wise way?

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-05 : 23:44:29
add a grouping to the table based on field
=Fields!Type.value and use two columns with values as

Type(table Col1) Total( table Col2)
=Fields!Type.value SUM(Fields!Amount.value)
Go to Top of Page

zhshqzyc
Posting Yak Master

240 Posts

Posted - 2008-12-08 : 09:29:16
Well, what I got is
Cash      2000
Cash 2000
Cash 2000
Cash 2000
Cash 2000
Cash 2000

They are duplicated. I only want to show one row.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-08 : 09:43:06
quote:
Originally posted by zhshqzyc

Well, what I got is
Cash      2000
Cash 2000
Cash 2000
Cash 2000
Cash 2000
Cash 2000

They are duplicated. I only want to show one row.



have you applied grouping as i suggested?
Go to Top of Page

zhshqzyc
Posting Yak Master

240 Posts

Posted - 2008-12-08 : 10:37:26
Okay.

I added.

May I get the rows count?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-09 : 03:18:13
quote:
Originally posted by zhshqzyc

Okay.

I added.

May I get the rows count?


use countrows() function. add scope parameter to dataset or group name based on whih count you want.
Go to Top of Page
   

- Advertisement -