Focal Point
(FOC2597) USE OF DEFINE FIELD THAT CANNOT BE AGGREGATED

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

January 22, 2008, 03:51 AM
Prasanna
(FOC2597) USE OF DEFINE FIELD THAT CANNOT BE AGGREGATED
Hi,
I am trying to pull some calculation which is there in DEFINE in to TABLE FILE. But while creating the SQL query it is not recognizing the DEFINED column and it is throwing following error.
AGGREGATION NOT DONE FOR THE FOLLOWING REASON: (FOC2597) USE OF DEFINE FIELD THAT CANNOT BE AGGREGATED

I tried creating separate table where i gave the column that i needed in the DEFINE, and put the condition that i validated in DEFINE as WHERE condition. Later i thought of merging both the table using MATCH. But the second table is not giving me the desired result.

Does anyone faced same type of issue or previous forum discussion is available?


Dev:
Dev Studio 7.1.6,Report Caster 7.1.1,Servlet
Local:
Dev Studio 7.1.6,Report Caster 7.1.1,Apache 5.0.2,
Win XP


January 22, 2008, 04:01 AM
FrankDutch
Prasanna

Please post your code in between [ code] and [ /code] (forget the spaces)

I suppose you have a sum in your difine but without the code it is difficult to be sure.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

January 22, 2008, 04:23 AM
Prasanna
Here is the model of the program that i am trying.
DEFINE FILE T1
COL1/D12=IF COL2='Y' THEN AMOUNT ELSE 0;
END
-RUN
TABLE FILE T1
SUM 
COL3
COL1
BY CNUM
BY MBRID
WHERE CNUM EQ &CLIENT
ON TABLE PCHOLD FORMAT HTML
END 
-RUN
 



Dev:
Dev Studio 7.1.6,Report Caster 7.1.1,Servlet
Local:
Dev Studio 7.1.6,Report Caster 7.1.1,Apache 5.0.2,
Win XP


January 22, 2008, 06:57 AM
FrankDutch
If Amount is a filed in your T1 master AND if COL2 is an alpha field in your T1 master then this should work.

Is it?

And what about the other fields?

Can you post your master?




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

January 22, 2008, 07:14 AM
focuzsambit
wats the datatype for AMOUNT.
Same should be thr for col1.
if its D20, then for Col1 it should also be D20


WF Server: 7.1.4 on Z/OS and Linux, ReportCaster
Data: DB2, DB2/UDB, Adabas, SQL Server, Oracle Output: HTML,PDF,Excel2K
WF Client: Servlet, CGI
January 22, 2008, 08:04 AM
FrankDutch
Focuszambit

You are not right on all points.
You may change te picture form D20 to D12 but you must realize that the result might not fit, but if the used value is less than 12 characters it would not give any problem.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

January 22, 2008, 09:54 AM
Francis Mariani
A lot of DEFINE statements will not get translated to SQL.

The message you get is not an error, but a warning - the report should still run, though it could take a very long time because the data is not aggregated by the DBMS.

In situations like this I usually do not perform the DEFINE in the data extraction part of my program, I would do something like this:

TABLE FILE T1
SUM 
AMOUNT
COL3
BY CNUM
BY MBRID
BY COL2
WHERE CNUM EQ &CLIENT
ON TABLE HOLD AS H001
END
-RUN

DEFINE FILE H001
COL1/D12=IF COL2='Y' THEN AMOUNT ELSE 0;
END
-RUN

TABLE FILE H001
SUM 
COL3
COL1
BY CNUM
BY MBRID
ON TABLE PCHOLD FORMAT HTML
END 
-RUN



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
January 23, 2008, 09:35 AM
jgelona
Try using COMPUTE if there is only one COL2 for every CNUM and MBRID:
TABLE FILE T1
SUM 
COL3
AMOUNT NOPRINT
MAX.COL2 NOPRINT
COMPUTE COL1/D12=IF MAX.COL2='Y' THEN AMOUNT ELSE 0;
BY CNUM
BY MBRID
WHERE CNUM EQ &CLIENT
ON TABLE PCHOLD FORMAT HTML
END 
-RUN

Depending on how your data relationships and structure, this may work.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.