Focal Point
Two ACROSS statements - silly question

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

June 16, 2008, 04:07 PM
Francis Mariani
Two ACROSS statements - silly question
SET PAGE=NOPAGE
TABLE FILE CAR
SUM
DEALER
BY BODYTYPE
ACROSS COUNTRY
SUM
SALES
BY BODYTYPE
ACROSS COUNTRY NOPRINT
ACROSS SEATS
END


I'm getting one DEALER column and then 9 SALES columns, I thought I'd get a DEALER column for each COUNTRY.

Mad


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
June 16, 2008, 04:14 PM
Danny-SRL
Francis,

The ACROSS statement in the first SUM is ignored. In multi-set requests you have only BYs, the ACROSSs affect only the last set.


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

June 16, 2008, 04:15 PM
Francis Mariani
Red Face Red Face Red Face

Danny, thanks!

Thant's too bad.

Red Face Red Face Red Face


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
June 16, 2008, 04:24 PM
Danny-SRL
Francis,

I can't resist sending you this:
  
-* File across2.fex
SET HOLDLIST=PRINTONLY
TABLE FILE CAR
SUM
DEALER
BY BODYTYPE
BY COUNTRY
SUM
SALES
BY BODYTYPE
BY COUNTRY 
BY SEATS
ON TABLE HOLD
END
TABLE FILE CAR
BY SEATS
ON TABLE SAVE
END
-RUN
-SET &SMAX=&LINES;
DEFINE FILE HOLD
-REPEAT #E FOR &I FROM 1 TO &SMAX;
-READ SAVE,&SEAT
-SET &T.&I=&SEAT;
SALE&I / I6 = IF SEATS EQ &SEAT THEN SALES ELSE 0;
-#E
END
TABLE FILE HOLD
SUM DEALER
-REPEAT #T FOR &I FROM 1 TO &SMAX;
SALE&I AS '&T.&I SEATER'
-#T
BY BODYTYPE
ACROSS COUNTRY
END



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

June 17, 2008, 02:46 PM
Chartran
Hi Francis

It looks like your getting ACROSS SEATS, ACROSS EACH COUNTRY ?

This looks like you're getting what your code is describing, but removing the last "ACROSS SEATS" might get you closer to what you want ?

CL

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


CharLee
June 17, 2008, 03:19 PM
Francis Mariani
Danny, clever use of DM!


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
June 18, 2008, 03:13 AM
Chartran
Francis,

Do you NOT want a column for each "SEATS" that has data for each COUNTRY ?

Or, do you want an aggregate total for "ALL SEATS" for each COUNTRY ?

The first gives a Cartesian Product of SEATS x COUNTRY = # of columns in the output, if I understand you correctly ?

Is the second (aggregate) way that would give a single column per COUNTRY what you want ?

I'd like to see the solution that you find.
Thanks


CharLee