Use an Aggregate function in Sort Expression

ぃ、小莉子 提交于 2019-12-23 07:56:02

问题


I have a report which uses a dataset returned from a stored procedure. There are two key columns: Name and Value

I am using this dataset for two tablixes. The first is just a straightforward tablix displaying the data.

The second groups the data based on a Name column. I need to order this data based on the Sum of Value column

However I get the following error:

[rsAggregateInDataRowSortExpression] A sort expression for the tablix 'table1' includes an aggregate function. Aggregate functions cannot be used in data row sort expressions.

Is there another way I can show the data grouped by name and still order it by Sum(Value)?


回答1:


Instead of sorting on the tablix you need to sort against the row group. Remove the sort on the tablix and then go to the row group properties and put the same sort expression under the sorting section there, this should then work.




回答2:


OK, I just had to add an extra column for the the Sum value to my query and then use that. Not ideal, but it works



来源:https://stackoverflow.com/questions/6385176/use-an-aggregate-function-in-sort-expression

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