Jump to content

Has anyone been successful in using the Aggregate WITHIN fun...


Douglas Lee 2

Recommended Posts

TABLE FILE ibisamp/car

 

SUM CAR.BODY.DEALER_COST

PCT.CAR.BODY.DEALER_COST WITHIN CAR.ORIGIN.COUNTRY AS DEALER_COST,within COUNTRY

PCT.CAR.BODY.DEALER_COST WITHIN CAR.COMP.CAR AS DEALER_COST,within CAR

BY CAR.ORIGIN.COUNTRY UNDER-LINE RECOMPUTE SUM. CAR.BODY.DEALER_COST SUM. PCT.CAR.BODY.DEALER_COST AS Subtotal:

BY CAR.COMP.CAR

BY CAR.CARREC.MODEL

 

image.png1433703 64 KB

Link to comment
Share on other sites

Would you please try one more, as follows, using GGsales do you get .00 as percentages or accurate decimals Note that UNITS is I08 and the result is displayed in the actual format of the source field.

TABLE FILE ibisamp/ggsales

SUM GGSALES.SALES01.UNITS

PCT.GGSALES.SALES01.UNITS WITHIN GGSALES.SALES01.DATE

PCT.GGSALES.SALES01.UNITS/D12.2% WITHIN GGSALES.SALES01.DATE

BY LOWEST 5 GGSALES.SALES01.DATE RECOMPUTE AS Subtotal:

BY GGSALES.SALES01.CATEGORY

Link to comment
Share on other sites

Unit Sales is an I8 field. Reformatting it to a D12.2 wont make the rounding problem go away. You need to DEFINE a new field instead of /D12.2.

DEFINE FILE ibisamp/ggsales

UNIT_SALES_D/D12.2=GGSALES.SALES01.UNITS ;

END

ENGINE INT CACHE SET ON

SET PAGE-NUM=NOLEAD

SET SQUEEZE=ON

-DEFAULTH &WF_HTMLENCODE=ON;

SET HTMLENCODE=&WF_HTMLENCODE

SET HTMLCSS=ON

-DEFAULTH &WF_EMPTYREPORT=ON;

SET EMPTYREPORT=&WF_EMPTYREPORT

-DEFAULTH &WF_ARVERSION=2;

SET ARVERSION=&WF_ARVERSION

-DEFAULTH &WF_SUMMARY=Summary;

-DEFAULTH &WF_TITLE=WebFOCUS Report;

TABLE FILE ibisamp/ggsales

SUM GGSALES.SALES01.UNITS

PCT.UNIT_SALES_D WITHIN GGSALES.SALES01.DATE

BY GGSALES.SALES01.DATE RECOMPUTE AS Subtotal:

BY GGSALES.SALES01.CATEGORY

ON TABLE PCHOLD FORMAT HTML

ON TABLE NOTOTAL

ON TABLE SET CACHELINES 100

ON TABLE SET GRWIDTH 1

ON TABLE SET STYLE *

INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,$

TYPE=REPORT, TITLETEXT=&WF_TITLE.QUOTEDSTRING, SUMMARY=&WF_SUMMARY.QUOTEDSTRING, ORIENTATION=LANDSCAPE, $

ENDSTYLE

END

-RUN

 

image.png946497 48.7 KB

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...