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.
Author |
Topic |
developer101
Starting Member
6 Posts |
Posted - 2011-10-26 : 10:33:26
|
Hello AllNew to this forum. Exciting!I can develop basic reports in SSRS and been using it for few months. Now I have a query.Lets say I need to create extra columns in a report as a formula or expression and calculate a value based on other columns. Forexample,=Fields!Sales.Value - Fields!Cost.ValueSo I did that. I created a column named foreample Margin and added the above formula to it. Now lets say I want to add another column which is Margin%. The calculation of this column will be based on Margin column I created previously.The formula for this column will be (this is where I am struggling)Margin / Fields!Sales.Value * 100Now how can I put the above formula as expression in SSRS? How can I refer to Margin column I created? Fields!Margin.Value won't work? What is the solution? Do I need to create variable? If yes then how? Please any help will be appreciated. Thanks. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-26 : 13:59:09
|
the solution is either to repeat formula for margin in second textbox or name the first textbox as Margin and then use in second textbox likeReportItems!Margin.value/Fields!Sales.Value * 100------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
developer101
Starting Member
6 Posts |
Posted - 2011-10-27 : 04:45:05
|
quote: Originally posted by visakh16 the solution is either to repeat formula for margin in second textbox or name the first textbox as Margin and then use in second textbox likeReportItems!Margin.value/Fields!Sales.Value * 100
Wow great. This answers my question. I didn't have the idea of ReportItems! cheeeeers!! |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-27 : 04:47:29
|
no problem you're welcome ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|