在排序表达式中使用聚合函数 [英] Use an Aggregate function in Sort Expression
问题描述
我有一个报告,该报告使用从存储过程返回的数据集。有两个关键列:名称和值
I have a report which uses a dataset returned from a stored procedure. There are two key columns: Name and Value
我正在将此数据集用于两个Tablix。第一个只是显示数据的简单Tablix。
I am using this dataset for two tablixes. The first is just a straightforward tablix displaying the data.
第二个基于 Name 列对数据进行分组。我需要根据值列的总和对该数据进行排序
The second groups the data based on a Name column. I need to order this data based on the Sum of Value column
但是我遇到以下错误:
[rsAggregateInDataRowSortExpression] Tablix
'table1'的
排序表达式包括一个总计
函数。聚合函数
不能用于数据行排序表达式。
[rsAggregateInDataRowSortExpression] A sort expression for the tablix 'table1' includes an aggregate function. Aggregate functions cannot be used in data row sort expressions.
还有另一种方式可以显示按名称分组的数据仍然按Sum(Value)排序吗?
Is there another way I can show the data grouped by name and still order it by Sum(Value)?
推荐答案
好,我只需要为Sum值添加一个额外的列到我的查询,然后使用它。不理想,但是可以用
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
这篇关于在排序表达式中使用聚合函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!