Calculating SSRS

Hi!

I want to make a calculated field in my report builder. I want to add two columns together. Like such:

InvcDtl.TotalMiscChrg + InvcDtl.DocExtPrice

I am doing this incorrectly, as it only produces just those words on the report.

How would I write this so it produces the result?

Thank you!

in Expression box, enter the following expression to add the two fields
=Fields!TotalMiscChrg.Value + Fields!DocExtPrice.Value

5 Likes

Hello! Thank you for your response.

When I go to save, it gives me this error:

The Field expression for the dataset ‘BAQReportResult’ refers to the field ‘TotalMiscChrg’. Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. Letters in the names of fields must use the correct case.

Update: I probably have to add it to the Expression of the dataset itself:

If this is the case, how do I format it correctly?

The error was tell you that TotalMiscChrg is not a valid field… but InvcDtl_TotalMiscChrg is.

You need to use the same field references that are in your query. So, you’ll need to add the table prefixes in your expression:

image

=Fields!InvcDtl_TotalMiscChrg.Value + Fields!InvcDtl_DocExtPrice.Value

2 Likes

Sometimes I take things too literally. Thank you, both! That worked.

1 Like

Don’t we all! :rofl:

Rogues are overpowered! - General Discussion - World of Warcraft Forums

If it helps, in the future, when you’re writing your expressions… in the editor, if you click on the “Fields (BAQReportResult)” on the left, it will show you all the available fields you can use.

Then, if you double-click on the field you want on the right hand side, it will plop it into the expression for you.

1 Like