Focal Point
[SOLVED]Using Computed Fields in the Where Clause

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

August 11, 2011, 12:17 PM
SeyedG
[SOLVED]Using Computed Fields in the Where Clause
Hi All,
We are using WebFocus 7.6.11. I would like use a computed field to force a graph to page break when the count equals to 1. What is the syntax for using the computed field in the where clause? I searched this forum, but didn't find the answer.

Thank you,

Seyed

This message has been edited. Last edited by: SeyedG,


WebFOCUS 8.0.09
App Studio 8009
Linux Kernel-2.6
DBMS: Oracle 11g
all output (Excel, HTML, AHTML, PDF)
August 11, 2011, 02:00 PM
Tom Flynn
WHERE TOTAL CNT EQ 1;


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
August 12, 2011, 02:31 PM
SeyedG
Hello Tom,
Thank you so much for helping with this. This answers my question.

Seyed


WebFOCUS 8.0.09
App Studio 8009
Linux Kernel-2.6
DBMS: Oracle 11g
all output (Excel, HTML, AHTML, PDF)
September 29, 2011, 04:32 PM
texgator
For some reason the 'WHERE TOTAL' line in the following code doesn't seem to be working. Everything else in the report works fine. Can anyone see what's wrong here. Thanks.

  
TABLE FILE APDISCOUNTS3
PRINT
CTVENO AS 'Supplier'
NANAME AS 'Supplier Name'
VPSLDT AS 'Settled Dt'
VPSCAM/D14.2!D AS 'Settled Amt'
DISCA/D14.2!D AS 'Discount Allowed'
E28/D14.2!D AS 'Discount Taken'
COMPUTE DISCL/D14.2!D = DISCA - E28; AS 'Discount Lost'

ON TABLE SUMMARIZE AS 'TOTAL'
HEADING
"AP Discounts Lost by Cost Center for &MNTH, &ACCYR"
FOOTING
""
WHERE VPSTPR EQ '&ACCPER' AND CTCSTS EQ '&CCENTER';
WHERE TOTAL DISCL NE 0;
END



WebFOCUS 7.6.10
Windows
all output (Excel, HTML, PDF)
September 29, 2011, 08:25 PM
Dan Satchell
Maybe it is working but DISCL has non-zero values that display as zero when rounded to 2 decimal places? Try changing your format for DISCL from 'D' to 'P':

COMPUTE DISCL/P14.2!D = DISCA - E28; AS 'Discount Lost'



WebFOCUS 7.7.05
September 30, 2011, 06:05 AM
Tom Flynn
Use another column with NOPRINT and do not use a "reporting/display only" format:
  
    COMPUTE DISCL/D14.2!D   = DISCA - E28; AS 'Discount Lost'
    COMPUTE DISC_LOST/P15.2 = DISCA - E28; NOPRINT

Then use DISC_LOST in the WHERE statement:
   WHERE TOTAL DISC_LOST NE 0;



Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
September 30, 2011, 01:17 PM
texgator
Thanks guys. I followed your suggestions and it worked.


WebFOCUS 7.6.10
Windows
all output (Excel, HTML, PDF)