Wednesday, 21 August 2013

Conditional request from SSRS 2005 DataSet in an expression

Conditional request from SSRS 2005 DataSet in an expression

I'm having difficulty with what seems to be a limitation in SSRS (BIDS)
2005, and upgrading to a newer version is not yet an option for me.
I have a DataSet that returns a bunch of payroll withholding data by
employee, and I'm wanting to get the value of field "B" based on what I
find in field "A." Specifically, I want to get a dollar amount based on a
field "Code" being "OptlLife."
So, if Field A = "OptLife" give me the dollar value of Field B. Pretty
simple, right?
The closest I can come is:
=IIF(First(Fields!Code.Value, "Withholdings") = "OptLife",
First(Fields!AmtPct.Value, "Withholdings"), " ")
What's killing me is that "First" indicator. I don't want "first" or
"last" or "max" or "sum." I want whatever row of data has the value
OptLife. If I remove that indicator, I get a syntax error. How do I get
around this?
What I really want is something like "select AmtPct from
WithholdingsDataSet where Code = "OptLife" but it needs to be an SSRS
expression.

No comments:

Post a Comment