Focal Point
count distinct with D

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4997061086

January 08, 2016, 02:20 AM
Dave
count distinct with D
I have this simple query.

TABLE FILE CAR
  SUM CNT.DST.CAR
END


Returns 10

TABLE FILE CAR
  SUM CNT.DST.CAR/D6
END


Returns 1 Eeker

SQL produced: ( when running on a real database, not CAR )


SELECT
 COUNT(DISTINCT  COUNT(DISTINCT T2."WTF_ID"))(INTEGER),
 SUM(T2."WTF_ID")(INTEGER)
 FROM
 INGRESS.P06;


With these warnings ( no errors, it just continues )
FOC2589 - AGGREGATION DONE BUT MAY PRODUCE INCONSISTENT RESULTS
FOC2612 - OVERFLOW MAY OCCUR WHEN SUMMING AN I2 FIELD WITH USAGE I, D OR P

A count distinct over a count distinct? Seems like something got lost in translation.


Is this adapter specific?

Greets,
Dave


_____________________
WF: 8.0.0.9 > going 8.2.0.5
January 08, 2016, 03:50 AM
Wep5622
A distinct count of distinct counts? Peculiar!

That looks a lot like the a bug I reported in 8.1.03 where the generated query contains a syntax error because it contains 2 distinct clauses.

Unfortunately, tech support seems to be offline at the moment, or I would have had more details.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
January 08, 2016, 04:48 AM
Danny-SRL
I tried.
In both cases I get 10.
However with the format the TITLE is CAR,COUNT; without the format it is COUNT,DISTINCT,CAR.
Go figure!


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

January 08, 2016, 11:17 AM
jgelona
I've never seen that with Oracle.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
January 12, 2016, 10:22 AM
BabakNYC
I just tested SUM CNT.DST.CAR/D6 in WF 8105 using both Oracle and SQL Server and got the following correct translation:

AGGREGATION DONE ...
SELECT
COUNT(DISTINCT T1."CARS")
FROM
HR.CAR_ORA T1;

AGGREGATION DONE ...
SELECT
COUNT(DISTINCT T1."CARS")
FROM
CAR_MSS T1;

Unfortunately, I don't have access Ingress to test.


WebFOCUS 8206, Unix, Windows