Focal Point
Mutliple Counts in a BY

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

November 02, 2006, 02:20 PM
MadamZuZu
Mutliple Counts in a BY
hi Smiler

here is my little problem.

DEFINE FILE CAR
CNTR/I1=1;
END

TABLE FILE CAR
SUM CNTR
MODEL
BY COUNTRY
BY CAR
BY BODYTYPE
ON COUNTRY SUBFOOT
"<ST.CNTR IN <COUNTRY"
END


on country i want to do a subfoot saying
this is how many different cars and bodytypes there are in this country.


the code i have now, only gives me the count for the bodytype...how do i get the total counts for the car?

hope i didn't confuse anyone Smiler
please help Smiler


~~~||~~~||~~~||~~~||~~~||~~~||~~~||~~~||~~~||~~~
PROD: WebFOCUS 7.1.3 on Win 2K/IIS 6/ISAPI Mode/Self-Serve Apps Only (No App Server)
TEST: WebFOCUS 7.1.3 on Win 2K/IIS 6/Weblogic 8.1/Servlet Mode
November 02, 2006, 02:27 PM
Leah
Try this:

DEFINE FILE CAR
CNTR/I3=1;
CNTR2/I3=1;
END

TABLE FILE CAR
SUM CNTR2
BY COUNTRY
SUM CNTR
MODEL
BY COUNTRY
BY CAR
BY BODYTYPE
ON COUNTRY SUBFOOT
"[ST.CNTR2 CARS [ST.CNTR BODIES IN [COUNTRY"
END

I forget how to get the code to stick


Leah
November 03, 2006, 02:39 AM
Tony A
One thing we forget is that you are not restricted to using SQL only for SQL sources. And as, sometimes, SQL con provide an easier method of achieving things such as this you could resort to using SQL against the CAR file (or any other for that matter) -
-* File car_sql.fex
SQL
  SELECT COUNT(CAR)      AS CAR_COUNT
       , COUNT(MODEL)    AS MODEL_COUNT
       , COUNTRY
    FROM CAR
GROUP BY COUNTRY
;
TABLE
PRINT *
HOLD AS SQLOUT
END
TABLE FILE SQLOUT
SUM MAX.CAR_COUNT
    MAX.MODEL_COUNT
 BY COUNTRY
END


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
November 03, 2006, 04:57 PM
MadamZuZu
Thanks!


~~~||~~~||~~~||~~~||~~~||~~~||~~~||~~~||~~~||~~~
PROD: WebFOCUS 7.1.3 on Win 2K/IIS 6/ISAPI Mode/Self-Serve Apps Only (No App Server)
TEST: WebFOCUS 7.1.3 on Win 2K/IIS 6/Weblogic 8.1/Servlet Mode