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.
EDIT PER IAN'S QUESTION:
So, I have a result set from the DataSet that looks like this.
Employee Code Method AmtPct
1121 401K A 400
1121 Roth null null
1121 FSAChild A 96.15
1121 FSAHealth A 192.31
1121 OptLife A 28.84
In my report, I have a textfield formatted for Currency, and need an expression that will pull the 28.84 into that field. Because I have multiple DataSets tied to this report, I need to specify which DataSet the value is coming from, hence the (Fields!Code.Value, "Withholdings") but that parenthetical statement has to be prepended with something. Nothing I put there gives me the value I need.
Once I nail this down, the same methodology will be used for distinguishing Roth and Traditional 401K, and FSA Childcare from FSA Healthcare.