Focal Point
[SOLVED] One pass on the data

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

April 28, 2009, 05:37 AM
Danny-SRL
[SOLVED] One pass on the data
Please look at the output below. I use 1 HOLD file to produce it. Can somebody come up with a solution that doesn't need a HOLD file (1 pass on the data)?

  
PAGE     1
  
  
                           SEATS 
                           002         004         005         TOTAL       
  COUNTRY                                                                  
  -------------------------------------------------------------------------
  
  ENGLAND     SALES                 0           0       12000       12000  
              RETAIL_COST      13,978      17,850      13,491      45,319  
              DEALER_COST      11,719      14,940      11,194      37,853  
              D2R_ratio        83.84%      83.70%      82.97%      83.53%  
  
  ITALY       SALES             25400        4800           .       30200  
              RETAIL_COST      45,140       5,925           .      51,065  
              DEALER_COST      36,320       4,915           .      41,235  
              D2R_ratio        80.46%      82.95%           .      80.75%  
  
  JAPAN       SALES                 .       78030           .       78030  
              RETAIL_COST           .       6,478           .       6,478  
              DEALER_COST           .       5,512           .       5,512  
              D2R_ratio             .      85.09%           .      85.09%  
  
  TOTAL       SALES             25400       82830       12000      120230  
              RETAIL_COST      59,118      30,253      13,491     102,862  
              DEALER_COST      48,039      25,367      11,194      84,600  
              D2R_ratio        81.26%      83.85%      82.97%      82.25%  

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


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

April 28, 2009, 09:15 AM
j.gross
  
TABLE FILE CAR
SUM SALES 
OVER RETAIL_COST 
OVER DEALER_COST 
OVER COMPUTE RATIO/D5.2%=100 * DEALER_COST/RETAIL_COST;
BY COUNTRY
ACROSS SEATS RECOMPUTE 
ON TABLE SUMMARIZE
IF COUNTRY EQ E$* OR I$* OR J$*
END



- Jack Gross
WF through 8.1.05
April 28, 2009, 10:00 AM
<JG>
Other way is FML using the FORMULTIPLE OPTION gives a bit better print layout I think.

 
TABLE FILE CAR
SUM 
     SALES OVER 
     RETAIL_COST OVER 
     DEALER_COST OVER 
     COMPUTE D2R_ratio/D12.2 = ( C3 / C2 ) * 100;
ACROSS SEATS RECOMPUTE
FOR
     COUNTRY
'ENGLAND' AS 'ENGLAND' LABEL R1 OVER 
'ITALY' AS 'ITALY' LABEL R2 OVER 
'JAPAN' AS 'JAPAN' LABEL R3 OVER 
'ENGLAND' OR 'ITALY' OR 'JAPAN' AS 'Total' LABEL R4
ON TABLE SET PAGE-NUM OFF 
ON TABLE SET FORMULTIPLE ON 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
END
 

April 28, 2009, 12:26 PM
Danny-SRL
Thanks.

Jack, I completely forgot that RECOMPUTE can come after ACROSS!!! Red Face


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

April 29, 2009, 12:13 PM
j.gross
Dan --

It need not be in the ACROSS phrase:
ON {acrossfield} SUMMARIZE or RECOMPUTE has the same effect.

I find the semantics inconsistent:

(a) ACROSS ... RECOMPUTE does not inserts content at sort breaks (for the 3 respective values of SEATS); it just appends a single column of marginals on the right. So it's really an "On Table" level feature.

(b) But the corresponding ON TABLE phrase, ON TABLE SUMMARIZE and RECOMPUTE, doesn't generate a right-hand marginal when the request contains an ACROSS, just the bottom marginal.


- Jack Gross
WF through 8.1.05