Sql – two datasets – sql reporting services 2008

reporting-servicessql-server-2008

please can someone help.

I have two datasets I'm working with and two tables. I've managed to do one expression correct so do not understand why my second won't work.

My first expression is where I need to state the target number based on a result e.g.

=IIF(Fields!Line.Value = "B1", "10", IIF(Fields!Line.Value = "C1", "15", ""))

This works okay, but my next expression doesn't – here I'm trying to bring the result of B Line or C Line e.g.

=IIf(Fields!Line.Value="B1", Sum(Fields!Result.Value, "DataSet2"), IIF(Fields!LineName.Value = "B3", sum(Fields!Result.Value, "DataSet2"),""))

With this last formula it brings up the same information for all the lines, it doesn't take into account my IIF statement, so e.g. instead of it bringing 60 for Line B, and 40 for Line C, it brings up 100 for both B and C.

Can you tell me where I'm going wrong please.

Regards, AM

Best Answer

Right now, your formula is adding all the whole dataset column up and returning the sum. I think you would have to correct your IIF statement to get the related result.

Related Topic