问题
According to this it looks like you can use an aggregate function in a calculated field, but if I try and use the median command, I get an error
"the value expression for the field =Median( ...what I wrote below..) contains an error: BC30451 Name 'Median' is not declared.
I have tried
=Median(Fields!name_of_field_I_want_median_from.Value,"dsTheDatasetFieldIsIn")
and
=Median(Fields!name_of_field_I_want_median_from.Value)
neither work
N.B. Dataset is derived from MDX
回答1:
maybe I didn't understand your post, but I think that you use incorrect syntax. Try use next syntax:
Median(Set_Expression [ ,Numeric_Expression ] ),
where Numeric_Expression --- it's your measure.
P.S. Also, you can post full expression of your calculated member.
回答2:
Unfortunately Median is not an SSRS function , or it does not work inside an aggregate on an SSRS dataset.
My simple workaround if you are stuck with SSRS.
- Create a Bar Chart with the data set you're investigating .
- Add a calculated set to the chart (and you can pick Median or Mean or any other stat).
- Select to "show data label" on the Median set show exact number.
Best of Luck.
来源:https://stackoverflow.com/questions/8897596/use-of-median-function-in-calculated-field-in-ssrs