View Full Version : strange distinct count...

12-01-2003, 01:33 AM
I used the following measure:
Measure name="Count" column="itemid" aggregator="distinct count" formatString="#,###"/>
until when expanding it generated this sql (not the double distinct... that wasn't good ..
sql=[select "legalentity"."legalentitycode" as "c0", distinct count(distinct "invoiceitem"."itemid") as "m0" from "legalentity" as "legalentity", "invoice" as "invoice", "invoiceitem" as "invoiceitem" where "invoiceitem"."invoiceid" = "invoice"."invoiceid" and "invoice"."legalentityid" = "legalentity"."legalentityid" group by "legalentity"."legalentitycode"]
so.. now I use just count (since they are distinct anyways), but the question is what caused this error? I may need to use distinct count somewhere else..

12-01-2003, 06:21 PM
What query are you running?

12-01-2003, 11:30 PM
Error while executing query
[select {[Profit Center].[All Profit Centers]} ON Rows,
Hierarchize(Union(Crossjoin({[Company].[All Companys]}, {[Measures].[Amount], [Measures].[Count]}), Crossjoin([Company].[All Companys].Children, {[Measures].[Amount], [Measures].[Count]}))) ON rows
from [TB]
where count was defined as in myprevious post..
its our own db, so this probably won't mean much...

12-02-2003, 08:54 PM
Hmm. I can't see any obvious cause. The basic queries I'm running against FoodMart work fine.
Can you please log it as a bug? I won't get time to look at it very soon, but at least it will be out there.