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 |
CoffeeAddict
Yak Posting Veteran
94 Posts |
Posted - 2012-07-11 : 01:47:59
|
I'm trying to create an expression but the expression has to use 2 values from 2 rows in a secific group in my report:See a print screen of the report here: http://i.stack.imgur.com/KYkU6.jpgSo in the above, I've got the "Portfolio" group. that group I have 2 rows (based on the Desc differentiator actual and budget). And finally I have one row OUTSIDE the group called **variance**. The way I can distinguish between the rows is the field that is producing the text 'Budget' and 'Actual'..a field called Desc.I need to reference the Rent for both Actual and Budget for use in my Variance expression but cannot figure out how to reference those values for use in my expression.I've tried some stuff but not sure in SSRS how to do something like lookup(Portfolio.Fields!Desc.Value, "Actual", Fields!Rent, "MyDataSet)So that I can get the value for the Actual Rent and do the same to get the reference to the Budget Rent so I can use them in my Variance expressionSo ultimately I'm trying to do this (below is just pseudo code) as my variance expression for the Rent column (once I can figure out how the heck to get those 2 values from the rows above variance): =(lookup(Isnull(Portfolio.Fields!Desc.Value, "Actual", Portfolio.Fields!Rent, "MyDataSet), 0) / lookup(Portfolio.Fields!Desc.Value, "Actual", Portfolio.Fields!Rent, "MyDataSet)) - 1I just can't figure out how to get the lookup to reference my group and it's Desc field |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-07-11 : 11:06:28
|
use ReportItems!textbox.value for referring another report item. I hope they both are in same scope.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
CoffeeAddict
Yak Posting Veteran
94 Posts |
Posted - 2012-07-11 : 11:32:10
|
What do you mean you hope they're both in the same scope...what scope!!??? see that's what I'm saying how to scope it via the group or are you saying you hope it's the same scope as in the same dataset?quote: Originally posted by visakh16 use ReportItems!textbox.value for referring another report item. I hope they both are in same scope.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
|
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-07-11 : 11:35:05
|
what scope you've to tell us are they in same group within report? also whats expression you're using to get their value. are they coming from same field of table or are they from different field?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|
|
|