all groups > sql server reporting services > october 2006 >
You're in the

sql server reporting services

group:

Summing a calculated column


Summing a calculated column Elmo Watson
10/26/2006 4:27:54 PM
sql server reporting services:
In my report, one column is a calculated column based on two others

ColumnA - Quantity
ColumnB - Cost

Then, Column C multiplies Column A * Column B
=Fields!Quantity.Value*Fields!Cost.VALUE
That part works just fine

But - I need to (not in Footer), create a cell, that sums up all the values
in Column C. I've tried something like:
=Sum((Fields!Quantity.Value)*(Fields!Cost.Value))

But this returns an error - can someone shed some light on how to do this
correctly (please)?

RE: Summing a calculated column magendo_man
10/28/2006 1:39:01 PM
You could create a calculated field in Visual Studion by:

1) While on the layout tab bring up the field list for your dataset

2) right-click in the field list and select "Add" from the menu

3) You will get an add new field dialog box. In this enter your field name
(i.e. MyCost ) and then select the Calculated Field option.

4) Enter an expression defining your calculated field and OK this, i.e.
=Fields!Quantity.Value*Fields!Cost.VALUE

5) Change your textbox to use the above fieldname (MyCost) in the detail
lines rather than the expression

6) Change your total textbox use the expression =Sum(MyCost)

HTH,

--

Magendo_man

Freelance SQL Reporting Services developer
Stirling, Scotland


[quoted text, click to view]
AddThis Social Bookmark Button