Focal Point
[SOLVED] Possible to drop an across column?

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

September 15, 2009, 05:16 PM
Hua
[SOLVED] Possible to drop an across column?
DEFINE FILE CAR
MY_SALES/D12.2 = IF COUNTRY EQ 'ENGLAND' THEN 0 ELSE RETAIL_COST;
END
TABLE FILE CAR
SUM MY_SALES
BY CAR
ACROSS COUNTRY
-******WHERE COUNTRY NE 'ENGLAND';
ON TABLE SET STYLE *
END
  


Pretend the above report is the Car Sales by Country and there are non-zero figures in other countries for the Brit cars except in England.
Is it possible to drop the column by across-value = "England"? I need every bit of space for my report.

Thanks,

Hua

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


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
September 15, 2009, 05:39 PM
Waz
Do you need to keep the English cars ?

If not then just add a WHERE MY_SALES NE 0

Otherwise

TABLE FILE CAR
PRINT COMPUTE
      CNTR/I9 = LAST CNTR + 1 ; NOPRINT
      COMPUTE
      FOR_CAR/A23 = IF CNTR EQ 1 THEN '''' | CAR | '''' ELSE 'OVER ''' | CAR | '''' ;
BY CAR NOPRINT
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS FEX_CODE
END
-RUN
DEFINE FILE CAR
MY_SALES/D12.2 = IF COUNTRY EQ 'ENGLAND' THEN 0 ELSE RETAIL_COST;
END
TABLE FILE CAR
SUM MY_SALES
ACROSS COUNTRY
BY CAR ROWS
-INCLUDE FEX_CODE
WHERE MY_SALES NE 0
ON TABLE SET STYLE *
END

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


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

September 16, 2009, 11:15 AM
Hua
Waz,

I see your codes are working the way I wanted.

I couldn't digest the techques you're using here and hope you will help me out:
1. You use ACROSS before BY that I thought is not allowed. Why such a way?
2. How significant is the keyword "ROWS"?
3. How does INCLUDE inserting data into the CAR file? - as a row or column of cars in quotes? The cars displayed on the report is coming from the CAR file or from FEX_CODE?

When I commented out INCLUDE line, I got syntax error for the verb FOR and couldn;t figure out where in the code has this verb. Are you using FML to drop the column? I may not be able to utilize this technique at this moment because I not quite familiar with FML, but sure helpful when I know more about it.

Thanks.

Hua

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


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS