Jump to content

Hi community, Maybe a simple one (or at least the solution i...


Martin Yergeau

Recommended Posts

Hi community,

Maybe a simple one (or at least the solution is) but I cant figure it out.

In the below sample code I have a count on distinct products.

This is working great in detail and grand total rows but the sub-total is not showing the total for product count.

It does only if I remove the fields list on the ON REGION RECOMPUTE

But at that moment, I also have a total for BUDDOLLARS which I dont want.

I cant use the SUBFOOT technique because, in the real much more complex report, SUBFOOT is already used for something else and trying to mix total and other subfoot will cause even more non essential/desired complexity in the report.

Any ideas

TABLE FILE GGSALES

SUM DOLLARS/P8C AS 'Sales'

BUDDOLLARS/P8C AS 'Sales,Budget'

CNT.DST.PRODUCT/P8C AS 'Nb Prod'

BY REGION AS 'Region'

ON REGION RECOMPUTE

DOLLARS

PRODUCT

AS 'Sub-Total'

BY PRODUCT AS 'Product'

 

ON TABLE RECOMPUTE

DOLLARS

PRODUCT

AS 'Grand-Total'

 

ON TABLE SET PAGE-NUM NOLEAD

ON TABLE SET HTMLEMBEDIMG ON

ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *

INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,

$

ENDSTYLE

END

-RUN

Link to comment
Share on other sites

Playing around, I found a solution where the count is added in a COMPUTE

TABLE FILE GGSALES

SUM DOLLARS/P8C AS 'Sales'

BUDDOLLARS/P8C AS 'Sales,Budget'

COMPUTE CNT_PRD /P8C = CNT.DST.PRODUCT; AS 'Nb Prod'

BY REGION AS 'Region'

ON REGION RECOMPUTE

DOLLARS

CNT_PRD

AS 'Sub-Total'

BY PRODUCT AS 'Product'

 

ON TABLE RECOMPUTE

DOLLARS

CNT_PRD

AS 'Grand-Total'

 

ON TABLE SET PAGE-NUM NOLEAD

ON TABLE SET HTMLEMBEDIMG ON

ON TABLE SET HTMLCSS ON

ON TABLE SET STYLE *

INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,

$

ENDSTYLE

END

-RUN

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