April 2, 2014 at 4:05 am
Hi,
I have following expression in SSRS expression builder for a calculated field within a report. The report has several different datasets.
Sum(IIF(Fields!Flag2.Value = "SD" , AVG (Fields!NUM.Value), 0)
It errors because it requires a dataset name.
Question is, where in the expression do I add "Dataset1"
Thanks in advance
April 2, 2014 at 7:07 am
examples below:
=First(Fields!AField.Value, "DataSet3")
=Sum(Fields!ANotherField.Value, "DataSet3")
looking at your expression though I honestly don't think you can get that to work as you asking it to take an average if something equals SD and then sum it up. (I might be wrong though :hehe:)
April 2, 2014 at 7:22 am
Hi, you are not wrong, I'm trying to do it form memory and so probably have script wrong.
What need is an expression that works out the average for a subset of the data but MUST also define the dataset being used.
so basically .....
where the Fields!Flag2.Value = "SD" then give me the average of those values using DATASET2.
Sorry for any confusion
April 2, 2014 at 8:00 am
Only way I can think of is:
Assign the dataset in question to a tablix.
Set Row Group to Flag2 field.
Filter the tablix on the value you want to see (SD)
Put in three columns, Sum, Count and an average to make the calculation (Sum/Count)
Hide all the columns other than the calculated cell.
(Image attached)
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply