Focal Point
PCT Prefix Operator does not work on a COMPUTEd field

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

November 19, 2007, 04:50 PM
Francis Mariani
PCT Prefix Operator does not work on a COMPUTEd field
I was very surprised to discover that a PCT Prefix Operator does not work on a COMPUTEd field, the value in the PCT field is the same as the computed field.

JOIN CLEAR *
JOIN PCD IN GGSALES TO PCD IN GGPRODS AS J1
-RUN

TABLE FILE GGSALES
SUM
COMPUTE SALES_AMT/D12 = UNITS * UNIT_PRICE;
PCT.SALES_AMT/D20.4 AS 'SALES_PCT'
BY PRODUCT
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
November 19, 2007, 05:09 PM
smiths
Same in 7.6.2 Francis.

Sean


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
November 19, 2007, 05:13 PM
Francis Mariani
Sean,

Thanks for testing this. I couldn't find anything in the documentation that suggests this should not work.

Cheers,


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
November 19, 2007, 05:13 PM
mgrackin
Francis,

This makes sense. Obviously other prefix operators such as MIN, MAX, FST and LST would not work on a COMPUTE when SUMming because WF no longer knows the original detail records when it goes back to process the internal matrix.

I would guess that PCT does not work either because COMPUTEs are calcualted on a row by row basis and therefore WF does not know the TOTAL until it gets to the last record in the report. At that point it will not go back and process the records in the internal matrix again.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
November 19, 2007, 05:15 PM
Francis Mariani
Mickey,

Your argument makes sense.

Cheers,


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
December 01, 2007, 04:35 PM
FrankDutch
Would this work?


JOIN CLEAR * JOIN PCD IN GGSALES TO PCD IN GGPRODS AS J1 
-RUN 
DEFINE FILE GGSALES
DUMMY/A1='';
END
TABLE FILE GGSALES
 SUM 
COMPUTE SALES_AMT1/D12 = UNITS * UNIT_PRICE; NOPRINT
BY DUMMY NOPRINT
 SUM 
COMPUTE SALES_AMT2/D12 = UNITS * UNIT_PRICE; 
COMPUTE PCTSA/D7.2=SALES_AMT2/SALES_AMT1;
BY DUMMY 
BY PRODUCT 
END 
-RUN


just a thought..




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