[英]How do I Sum the values of a Count Distinct Aggregate of Contained Groups
I've got a bit of a problem with a grouping. 我在分组方面有些问题。 At the moment I have a grouping that does a CountDistinct(Fields!AccountName.Value). 目前,我有一个做CountDistinct(Fields!AccountName.Value)的分组。 This grouping is on a Financial Time Period. 该分组是在财务时间段内。
I need to be able to do a Sum on the values brought forward by this CountDistinct at the end of this report, but I can't put an aggregate function within an aggregate function. 我需要能够对本报告末尾此CountDistinct提出的值进行求和,但是我不能将聚合函数放在聚合函数中。
Don't suppose you guys have any idea's / help? 你们不知道有什么想法/帮助吗?
Thanks. 谢谢。
You can do a select and aggregate your set of aggregates. 您可以选择并聚合一组集合。 Something like: 就像是:
SELECT sum(total)
FROM (Select count(Fields!AccountName.Value) as total, name FROM x group by name) totals
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.