Here's how I do it.
-*******************************************************************************
-* TITLE : FOCEXEC (DRILLTHR)
-* SYSTEM : HEALTH
-* AUTHOR : GLENDA STURM
-* DATE WRITTEN : 5/17/2006
-* DESCRIPTION : COBC Rolling Year Views
-* INPUT FILES : COBCCNTS
-* OUTPUT FILES : EXCEL Spreadsheet
-*******************************************************************************
-* --------- PURPOSE ---------
-* This report will create an EXCEL document with several different worksheets.
-*******************************************************************************
-* --------- CHANGE LOG ---------
-*******************************************************************************
-* Processor 1
-*******************************************************************************
FILEDEF COBCCNTS DISK /edadata/pda/cobccnts.dat
-*********BY SUMMARY
DEFINE FILE COBCCNTS
INTERMEDIARY/A120 = COBCID||' - '||INTERMED;
CNTS/I9 = EDIT(QTY);
WEEKS/I8 = IF &YYMD GE 20070102
THEN 52
ELSE DATEDIF('20060102', DATEMOV('&YYMD', 'BOW'), 'WD')/5;
END
TABLE FILE COBCCNTS
HEADING
"COBC DETAIL"
" "
PRINT
*
CNTS
BY COMPANY
BY INTERMEDIARY
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='COBC DETAIL', $
TYPE=HEADING, SIZE=18, $
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K OPEN
END
TABLE FILE COBCCNTS
HEADING
"COBC BY INTERMEDIARY ACROSS WEEK"
" "
SUM
CNTS
ACROSS WEEKOF
BY COMPANY
BY INTERMEDIARY
WHERE COMPANY EQ 'ANTEX-A'
ON INTERMEDIARY ROW-TOTAL AS 'TOTAL'
ON TABLE SET BYDISPLAY ON
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='ANTEX-A BY INTERMEDIARY', $
TYPE=HEADING, SIZE=18, $
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K
END
TABLE FILE COBCCNTS
HEADING
"COBC BY INTERMEDIARY ACROSS WEEK"
" "
SUM
CNTS
ACROSS WEEKOF
BY COMPANY
BY INTERMEDIARY
WHERE COMPANY EQ 'ANTEX-B'
ON INTERMEDIARY ROW-TOTAL AS 'TOTAL'
ON TABLE SET BYDISPLAY ON
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='ANTEX-B BY INTERMEDIARY', $
TYPE=HEADING, SIZE=18, $
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K
END
TABLE FILE COBCCNTS
HEADING
"COBC BY INTERMEDIARY ACROSS WEEK"
" "
SUM
CNTS
ACROSS WEEKOF
BY COMPANY
BY INTERMEDIARY
WHERE COMPANY EQ 'SLAICO-A'
ON INTERMEDIARY ROW-TOTAL AS 'TOTAL'
ON TABLE SET BYDISPLAY ON
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='SLAICO-A BY INTERMEDIARY', $
TYPE=HEADING, SIZE=18, $
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K
END
TABLE FILE COBCCNTS
HEADING
"COBC BY INTERMEDIARY ACROSS WEEK"
" "
SUM
CNTS
ACROSS WEEKOF
BY COMPANY
BY INTERMEDIARY
WHERE COMPANY EQ 'SLAICO-B'
ON INTERMEDIARY ROW-TOTAL AS 'TOTAL'
ON TABLE SET BYDISPLAY ON
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='SLAICO-B BY INTERMEDIARY', $
TYPE=HEADING, SIZE=18, $
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K
END
TABLE FILE COBCCNTS
HEADING
"COBC BY WEEK ACROSS COBCID"
" "
SUM
CNTS
ACROSS COBCID
BY COMPANY
BY DAY
BY WEEKOF
WHERE COMPANY EQ 'ANTEX-A'
ON DAY ROW-TOTAL AS 'TOTAL'
ON TABLE SET BYDISPLAY ON
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='ANTEX-A BY DAY', $
TYPE=HEADING, SIZE=18, $
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K
END
TABLE FILE COBCCNTS
HEADING
"COBC BY WEEK ACROSS COBCID"
" "
SUM
CNTS
ACROSS COBCID
BY COMPANY
BY DAY
BY WEEKOF
WHERE COMPANY EQ 'ANTEX-B'
ON DAY ROW-TOTAL AS 'TOTAL'
ON TABLE SET BYDISPLAY ON
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='ANTEX-B BY DAY', $
TYPE=HEADING, SIZE=18, $
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K
END
TABLE FILE COBCCNTS
HEADING
"COBC BY WEEK ACROSS COBCID"
" "
SUM
CNTS
ACROSS COBCID
BY COMPANY
BY DAY
BY WEEKOF
WHERE COMPANY EQ 'SLAICO-A'
ON DAY ROW-TOTAL AS 'TOTAL'
ON TABLE SET BYDISPLAY ON
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='SLAICO-A BY DAY', $
TYPE=HEADING, SIZE=18, $
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K
END
TABLE FILE COBCCNTS
HEADING
"COBC BY WEEK ACROSS COBCID"
" "
SUM
CNTS
ACROSS COBCID
BY COMPANY
BY DAY
BY WEEKOF
WHERE COMPANY EQ 'SLAICO-B'
ON DAY ROW-TOTAL AS 'TOTAL'
ON TABLE SET BYDISPLAY ON
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='SLAICO-B BY DAY', $
TYPE=HEADING, SIZE=18, $
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K
END
TABLE FILE COBCCNTS
HEADING
"COBC SUMMARY BY WEEK"
" "
SUM CNTS
ACROSS WEEKOF
BY COMPANY
BY INTERMEDIARY
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='COBC SUMMARY BY WEEK', $
TYPE=HEADING, SIZE=18, $
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K
END
TABLE FILE COBCCNTS
HEADING
"COBC SUMMARY BY ID"
" "
SUM CNTS
ACROSS DAY
BY COMPANY
BY INTERMEDIARY
BY WEEKOF
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='COBC SUMMARY BY ID', $
TYPE=HEADING, SIZE=18, $
ENDSTYLE
ON TABLE PCHOLD FORMAT EXL2K CLOSE
END
Glenda
In FOCUS Since 1990
Production 8.2 Windows