TABLE FILE xxx SUM FELD1 AND COMPUTE SH/A1= IF FELD1 GE 0 THEN 'H' ELSE 'S'; AS '' BY FELD2 SUMMARIZE END
Like this, FELD1 is summarized correctly. Additionaly we want to create a 'H' or 'S' behind this sum, regarding whether the value is positive or negative. But SUM won't sum up alphanumeric fields. Is there a possibility to manage this? We also tried the RECAP-Command, but then the letter 'H' or 'S' is positioned in the next line.
We are using FOCUS7.2
Thanks for any advice! Stahl
April 29, 2004, 02:27 PM
Mikel
I think the report is correct and must give a good answer.
The computed field SH will be evaluated only 1 time for each value of FELD2 (due to SUM and BY), and referring to the previously summarized value of FELD1.
Example:
TABLE FILE CAR SUM COMPUTE VENTAS/I10 = SALES - 20000 ; COMPUTE SH/A1= IF VENTAS GE 0 THEN 'H' ELSE 'D'; AS '' BY COUNTRY END
Regards, MikelThis message has been edited. Last edited by: <Mabel>,
April 29, 2004, 02:32 PM
<Stahl>
Hi Mikel, the report body is correct, but what is missing is the letter "H" or "S" in the summary line when by sequenzer "FELD2" changes. Alphanumeric fields are not summarized and produce a blank. We want to add the letter "H" or "S" according to value of the summarized value. Regards Stahl
April 29, 2004, 03:03 PM
GUNTER
Try this: TABLE FILE CAR SUM COUNTRY CAR SALES IN 30 COMPUTE SH/A1= IF SALES GT 0 THEN 'H' ELSE 'S'; IN +0 AS '' BY COUNTRY NOPRINT BY CAR NOPRINT ON COUNTRY RECAP SSH/A1= IF SALES GT 0 THEN 'H' ELSE 'S'; NOPRINT ON COUNTRY SUBFOOT " " "TOTAL COUNTRY " " END
Regards
April 29, 2004, 04:14 PM
Mikel
GUNTER is right. You can use RECAP, but also, you must use the calculated field in subfoot in order to avoid automatic FOCUS positioning.
TABLE FILE CAR SUM COMPUTE TESTSALES/I9 = SALES - 20000 ; COMPUTE SH/A1= IF TESTSALES GE 0 THEN 'H' ELSE 'S'; AS '' IN +1 BY COUNTRY BY CAR ON COUNTRY RECAP SSH/A1= IF TESTSALES GE 0 THEN 'H' ELSE 'S'; ON COUNTRY UNDER-LINE SUBFOOT " " "TOTAL <31>" END Regards, MikelThis message has been edited. Last edited by: <Mabel>,