How can I get a running GROUP total with an across? As you can see the GROUP total for up to 5 is only the total for 5, it is not the cummulative total for 2,4, and 5 seats.
DEFINE FILE CAR GROUP/A20 = IF SEATS LE 2 THEN 'Up to 2 Seats' ELSE IF SEATS LE 4 THEN 'Up to 4 Seats' ELSE IF SEATS LE 5 THEN 'Up to 5 Seats'; END TABLE FILE CAR SUM SALES/D12 AS 'Sales' RETAIL_COST AS 'Retail,Cost' DEALER_COST AS 'Dealer,Cost' COMPUTE M1/D6.2% = RETAIL_COST / DEALER_COST; AS '%' BY GROUP NOPRINT BY SEATS AS 'Seats' BY BODYTYPE BY CARS ON GROUP SUBTOTAL ON SEATS SUBTOTAL ACROSS COUNTRY AS '' RECOMPUTE AS 'TOTAL COUNTRIES' ON TABLE NOTOTAL ENDThis message has been edited. Last edited by: Kerry,
WebFOCUS 7.6.10 Windows Excel, PDF, HTML
December 16, 2011, 10:15 AM
Kerry
Hi Swamp,
Can you please try the following:
DEFINE FILE CAR
GROUP/A20 = IF SEATS LE 2 THEN 'Up to 2 Seats' ELSE
IF SEATS LE 4 THEN 'Up to 4 Seats' ELSE
IF SEATS LE 5 THEN 'Up to 5 Seats';
END
TABLE FILE CAR
SUM
COMPUTE RTSEATS/I5=MAX.SEATS + RTSEATS; NOPRINT
BY GROUP
SUM
SALES/D12 AS 'Sales'
RETAIL_COST AS 'Retail,Cost'
DEALER_COST AS 'Dealer,Cost'
COMPUTE M1/D6.2% = RETAIL_COST / DEALER_COST; AS '%'
ACROSS COUNTRY AS '' RECOMPUTE AS 'TOTAL COUNTRIES'
BY GROUP
BY SEATS AS 'Seats'
BY BODYTYPE
BY CARS
ON GROUP SUBFOOT
" THIS IS THE RUNNING TOTAL <RTSEATS"
ON TABLE NOTOTAL
END
Cheers,
Kerry
Kerry Zhan Focal Point Moderator Information Builders, Inc.
December 17, 2011, 02:03 PM
Swamp
That only gives a running total of the number of seats. I need a running total of Sales, Retail Cost and Dealer Cost for EACH Country.
WebFOCUS 7.6.10 Windows Excel, PDF, HTML
December 20, 2011, 08:07 AM
Danny-SRL
Here is a solution. There probably is something shorter...
-* File swamp01.fex
SET ASNAMES=ON
TABLE FILE CAR
SUM
SALES
RETAIL_COST
DEALER_COST
BY COUNTRY
BY SEATS AS 'SEATS' ROWS 2 OVER 4 OVER 5
IF COUNTRY NE FRANCE
ON TABLE HOLD AS H1
END
DEFINE FILE H1
SEATS/I6=EDIT(SEATS);
END
TABLE FILE H1
SUM
SALES
COMPUTE TSALES/I6=IF COUNTRY NE LAST COUNTRY THEN SALES ELSE TSALES + SALES;
RETAIL
COMPUTE TRETAIL/I6=IF COUNTRY NE LAST COUNTRY THEN RETAIL ELSE TRETAIL + RETAIL;
DEALER
COMPUTE TDEALER/I6=IF COUNTRY NE LAST COUNTRY THEN DEALER ELSE TDEALER + DEALER;
BY COUNTRY
BY SEATS
ON TABLE HOLD AS H2
END
?FF H2
DEFINE FILE H2
GROUP/A20 = IF SEATS LE 2 THEN 'Up to 2 Seats' ELSE
IF SEATS LE 4 THEN 'Up to 4 Seats' ELSE
IF SEATS LE 5 THEN 'Up to 5 Seats';
END
TABLE FILE H2
SUM
TSALES TRETAIL TDEALER
BY GROUP
BY SEATS
ACROSS COUNTRY
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
TYPE=ACROSSVALUE,
ACROSS=1,
BACKCOLOR='WHITE',
$
ENDSTYLE
END
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF