开发者

How do I Sum the values of a Count Distinct Aggregate of Contained Groups

开发者 https://www.devze.com 2023-02-05 23:17 出处:网络
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). This grouping is on a Financial Time Period.

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). 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.

Don't suppose you guys have any idea's / help?

Thanks.开发者_如何学Python


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
0

精彩评论

暂无评论...
验证码 换一张
取 消