Okay with GGSALES:
DEFINE FILE GGSALES
NE_REGION/A20=IF GGSALES.SALES01.REGION EQ 'Northeast' THEN 'Northeast Region' ELSE 'Other Regions';
END
TABLE FILE GGSALES
SUM
'GGSALES.SALES01.UNITS'
'GGSALES.SALES01.DOLLARS'
'GGSALES.SALES01.BUDDOLLARS'
BY 'GGSALES.SALES01.CATEGORY'
BY 'GGSALES.SALES01.NE_REGION'
BY 'GGSALES.SALES01.ST'
HEADING
""
FOOTING
""
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE HOLD AS GG_HOLD FORMAT ALPHA
END
TABLE FILE GG_HOLD
SUM
COMPUTE R_CNT/I5 = IF GG_HOLD.GG_HOLD.NE_REGION EQ 'Northeast Region' THEN 0 ELSE ( R_CNT + 1 ); NOPRINT
COMPUTE PRT_ST/A6 = IF R_CNT LE 5 THEN GG_HOLD.GG_HOLD.ST ELSE 'Others';
AS 'ST'
'GG_HOLD.GG_HOLD.UNITS'
'GG_HOLD.GG_HOLD.DOLLARS'
COMPUTE PCT_BDG/D6.1% = ( GG_HOLD.GG_HOLD.DOLLARS / GG_HOLD.GG_HOLD.BUDDOLLARS ) * 100;
BY 'GG_HOLD.GG_HOLD.CATEGORY'
BY 'GG_HOLD.GG_HOLD.NE_REGION' RECOMPUTE AS '' NOPRINT
BY HIGHEST 5 'GG_HOLD.GG_HOLD.DOLLARS' NOPRINT PLUS OTHERS AS 'OTHERS'
ON GG_HOLD.GG_HOLD.CATEGORY RECOMPUTE AS '*TOTAL'
HEADING
""
FOOTING
""
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
Produces the following output:
CATEGORY ST UNITS DOLLARS PCT_BDG
Coffee NY 116659 1459160 99.4%
CT 109491 1364420 97.8%
MA 109628 1340437 96.5%
Northeast Region 335778 4164017 97.9%
MA 235583 2937886 99.2%
GA 127176 1576915 95.2%
WA 121180 1535631 98.2%
FL 114996 1463453 103.9%
IL 109581 1398779 102.4%
Others 331972 4154774 101.7%
Other Regions 1040488 13067438 100.2%
*TOTAL Coffee 1376266 17231455 99.6%
Food NY 125473 1555165 99.1%
CT 114439 1424718 99.2%
MA 113456 1400111 96.7%
Northeast Region 353368 4379994 98.3%
MA 222711 2768512 101.9%
IL 118068 1522847 102.8%
GA 120284 1490457 97.4%
MO 115731 1463901 102.2%
WA 117523 1433825 97.8%
Others 337160 4169797 99.6%
Other Regions 1031477 12849339 100.3%
*TOTAL Food 1384845 17229333 99.8%
Gifts CT 78510 992911 99.3%
MA 78825 967438 98.5%
NY 70194 887940 99.9%
Northeast Region 227529 2848289 99.2%
NY 152276 1935863 101.4%
WA 82766 1041229 101.5%
FL 79982 1034253 103.3%
GA 82823 1032735 97.4%
IL 79932 1002775 98.3%
Others 222572 2800358 100.9%
Other Regions 700351 8847213 100.7%
*TOTAL Gifts 927880 11695502 100.3%
If I change the NE_REGION to from RECOMPUTE to SUBTOTAL the output is as follows:
CATEGORY ST UNITS DOLLARS PCT_BDG
Coffee NY 116659 1459160 99.4%
CT 109491 1364420 97.8%
MA 109628 1340437 96.5%
Northeast Region 335778 4164017 293.7%
CA 235583 2937886 99.2%
GA 127176 1576915 95.2%
WA 121180 1535631 98.2%
FL 114996 1463453 103.9%
IL 109581 1398779 102.4%
Others 331972 4154774 101.7%
Other Regions 1040488 13067438 600.6%
*TOTAL Coffee 1376266 17231455 99.6%
Food NY 125473 1555165 99.1%
CT 114439 1424718 99.2%
MA 113456 1400111 96.7%
Northeast Region 353368 4379994 295.0%
CA 222711 2768512 101.9%
IL 118068 1522847 102.8%
GA 120284 1490457 97.4%
MO 115731 1463901 102.2%
WA 117523 1433825 97.8%
Others 337160 4169797 99.6%
Other Regions 1031477 12849339 601.8%
*TOTAL Food 1384845 17229333 99.8%
Gifts CT 78510 992911 99.3%
MA 78825 967438 98.5%
NY 70194 887940 99.9%
Northeast Region 227529 2848289 297.7%
CA 152276 1935863 101.4%
WA 82766 1041229 101.5%
FL 79982 1034253 103.3%
GA 82823 1032735 97.4%
IL 79932 1002775 98.3%
Others 222572 2800358 100.9%
Other Regions 700351 8847213 603.0%
*TOTAL Gifts 927880 11695502 100.3%
In the first output the first State in the Other Regions is repeated from the last State in the Northeast Region. In the second output the first State in the Other Regions is now correct.
I'm totally confused as to why this is happening.
WebFOCUS 7.7.03
Windows
all output (Excel, HTML, PDF)