Use of 'median' function in calculated field in SSRS

若如初见. 提交于 2019-12-25 08:49:55

问题


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.

  1. Create a Bar Chart with the data set you're investigating .
  2. Add a calculated set to the chart (and you can pick Median or Mean or any other stat).
  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!