how to sum a formula in SQL Reporting Services 2008

Hello:

Attached is an rdl.  I'm trying to produce a Grand Total for the "Sales Amt" column of this report.  (That column is the final column on the right.)

In that Sales Amt column, I already have a group sum.  And, the "Sales Amt" field itself in that column is a formula .  

I need a grand total.  This will amount to a third field in this column.  

How do I create this?

Apitech


Summary-Sales-By-Product2.txt
LVL 1
apitechAsked:
Who is Participating?
 
Nico BontenbalConnect With a Mentor Commented:
At the bottom of your screen in the Row Groups section right click the ItemClass row and select Add Total|After. This will give you a new total row. Right click the cell in the Sales Amt column on the Total row and choose Expression. Here you enter:
=sum(iif(Fields!SOPTYPE.Value=4,  -Fields!XTNDPRCE.Value,  Fields!XTNDPRCE.Value))
This should give you the total.
0
 
KretoniaCommented:
Are you trying to Sum Sums?
0
 
apitechAuthor Commented:
Exactly.  I know that there is not a way to do that.  But, that's how I was trying to explain it here in this posting.

The following is the group formula in SQL Reporting Services 2008 that sums the extended price column and specifically for each item class:

=Sum(iif(Fields!SOPTYPE.Value=4,
-Fields!XTNDPRCE.Value,
Fields!XTNDPRCE.Value))

Now, I want to do a “grand total” for this formula (on this column).  But, I cannot find the means to do this in SSRS.  I have tried doing a sum of that sum and I have tried the RunningValue function based on the textbox that this formula is in.  No dice.  

Thoughts would be very, very much appreciated!

Apitech
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
KretoniaCommented:
Api,

I know in BO I have to make separate variables for each Sum I had to cast the Sum ToNumber then Sum the Cast Results. I believe this is how I did it

First Step: As Variable
ToNumber ({@Sum FlxFstDisp})

Second Step: As Variable
Sum ({@FlexFstDispAmt})


0
 
apitechAuthor Commented:
Do I place these into the Expression "area" of the field?  Are these formulas?
0
 
Alpesh PatelAssistant ConsultantCommented:
Put Sum in variable and use at last.
0
 
apitechAuthor Commented:
Again, I ask "Do I place these into the Expression "area" of the field?  Are these formulas?"
0
 
KretoniaCommented:
Yes these would be formula's in expression format using a variable in the variable editor.
0
 
apitechAuthor Commented:
I'm still not seeing how this works.  Where is the "variable editor"?  Where do I place these formulas at?  How many variables do I creat?  How do I glean a "Grand Total" field (my ultimate goal) from definining variables?

I'm a total novice on how variables work in SQL Reporting Services 2008 (and 2005).  Could someone please methodically point out how I can get this accomplished?

I do appreciate the responses that I have received, thus far.  But, I do need step by step directions on this issue.

Thanks!  Again, it's very appreciated!

Apitech
0
 
apitechAuthor Commented:
Hi Nicobo!

That's exactly what I needed!  Thank you!!!!!!!!!!!!

That worked!!!

I was looking for something really simple like that!

Whew!  I was hoping that you would chime in on this!  Thank you, again, for doing so!

You're the best!

Apitech
0
 
apitechAuthor Commented:
Nicobo is awesome!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.