Jump to content

Recommended Posts

Posted

@nycbabak NYCBabak, What version of 8207 are you using We need to know if thats being backported to 8206.

Also, please show your code for whats shown above

Also, can you do that within COUNTRY instead of CAR

Posted

I just tested the same code in 8206.23 and it too works as expected. The code it generates is:

TABLE FILE ibisamp/car

SUM CAR.BODY.DEALER_COST

PCT.CAR.BODY.DEALER_COST WITHIN CAR.COMP.CAR

BY CAR.ORIGIN.COUNTRY

BY CAR.COMP.CAR

BY CAR.CARREC.MODEL

Posted

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

Posted

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

Posted

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

Posted
Thanks for the verification @nycbabak, Its not intuitive as I would like. But, it does make sense that the percentage is displayed in the same format as the source field. Ill add this to my work-arounds.

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...