Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] ROW-TOTAL doesn't RECOMPUTE with ACROSS

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] ROW-TOTAL doesn't RECOMPUTE with ACROSS
 Login/Join
 
Virtuoso
posted
Hi,

I have the following and I want the Grand Total also process the proper recompute for the "OT Hours %" which is not actually. It just summarize the percentage.
Any ideas ?

TABLE FILE CAR
SUM SALES AS 'Reg Hrs'
DEALER_COST AS 'Reg Pay'
COMPUTE OT_Hours /D10.2%=(SALES/DEALER_COST)/ 100; AS 'OT Hours %'
BY COUNTRY
ACROSS CAR ACROSS-TOTAL AS 'ACROSS TOT' RECOMPUTE
ON TABLE ROW-TOTAL AS 'GRAND TOTAL' RECOMPUTE
END

Thanks

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


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Master
posted Hide Post
It sounds like you would like another set of the Hrs, Pay, and OT Hours columns to appear at the end of your report, with the same values as you obtained with the ACROSS-TOTAL on CAR.

Below I commented out your ROW-TOTAL, and added another ACROSS command, that seems to give the 2nd set of total columns at the end of the report.

DEFINE FILE CAR
 GRAND/A1 = ' ';
END
TABLE FILE CAR
SUM     SALES       AS 'Reg Hrs'
        DEALER_COST AS 'Reg Pay'
COMPUTE OT_Hours /D10.2%=(SALES/DEALER_COST)/ 100; AS 'OT Hours %' 
BY      COUNTRY
ACROSS  GRAND ACROSS-TOTAL AS 'ACROSS TOT 2' RECOMPUTE 
ACROSS  CAR   ACROSS-TOTAL AS 'ACROSS TOT 1' RECOMPUTE
-*ON TABLE ROW-TOTAL AS 'GRAND TOTAL' RECOMPUTE
END
-EXIT 




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
 
Posts: 822 | Registered: April 23, 2003Report This Post
Virtuoso
posted Hide Post
Hi David,
Not exactly. I don't want the same values displayed. I want a sub-total of the across and a grand total of the row (the BY).
But the thing is when I have a COMPUTE in the SUM fields, it's summarized and not recomputed in the grand total.

Look in that example where the grand total PCT of Biscotti should be 8% and not 24.18% which is the sum of 7.81% + 8.53% + 7.84%.

TABLE FILE GGSALES
SUM UNITS
DOLLARS
COMPUTE PCT/D6.2% = UNITS/DOLLARS * 100; AS 'PCT'
BY PRODUCT
ACROSS ST
ACROSS STCD ACROSS-TOTAL AS 'STATE TOTAL' RECOMPUTE
WHERE ST EQ 'CA' OR 'CT';
ON TABLE ROW-TOTAL AS 'GRAND TOTAL' RECOMPUTE
END
-RUN

Regards,


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Virtuoso
posted Hide Post
Martin,

How about:
  
TABLE FILE GGSALES
SUM UNITS
DOLLARS
COMPUTE PCT/D6.2% = UNITS/DOLLARS * 100; AS 'PCT'
BY PRODUCT 
ACROSS ST ACROSS-TOTAL AS 'GRAND TOTAL' RECOMPUTE
ACROSS STCD ACROSS-TOTAL AS 'STATE TOTAL' RECOMPUTE
ON TABLE SUMMARIZE
WHERE ST EQ 'CA' OR 'CT';
END


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

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Virtuoso
posted Hide Post
Hi,

I finally make it run and my problem was a little more complex than I thought.

Your code was good Danny, but if you add another ACROSS ST NOPRINT as the first ACROSS, the total is not shown at the right place.

I found that my issue was that: I have another ACROSS MONTH_D NOPRINT prior an ACROSS MONTH_X because I want it ordered by the month number and not by the description of the month. I want: JAN, FEB, MAR, APR instead of APR, FEB, JAN, MAR which it be if it's only ordered by the month description.

So I had to play a little bit with the order of the ACROSS and ACROSS-TOTAL to make it run but it does now.

Thanks to both of you

Below illustration of what I'm saying above. I know that displaying ST_D is not really relevant, but if you want the "Product Total" title displayed, you don't have choice. And in my case, it's for month display, so having the number and the description it's ok.

DEFINE FILE GGSALES
ST_D /D1 = DECODE ST ('CA' 2 'CT' 1);
END

-* "Product Total" Not properly displayed
TABLE FILE GGSALES
SUM UNITS
DOLLARS
COMPUTE PCT/D6.2% = UNITS/DOLLARS * 100; AS 'PCT'
BY PRODUCT

ACROSS ST_D NOPRINT
ACROSS ST AS 'State'
ACROSS-TOTAL AS 'Product Total' RECOMPUTE

ACROSS STCD AS 'Store'
ACROSS-TOTAL AS 'State Total' RECOMPUTE
WHERE ST EQ 'CA' OR 'CT';
ON TABLE COLUMN-TOTAL RECOMPUTE
END
-EXIT

-* "Product Total" Properly displayed with title
TABLE FILE GGSALES
SUM UNITS
DOLLARS
COMPUTE PCT/D6.2% = UNITS/DOLLARS * 100; AS 'PCT'
BY PRODUCT

ACROSS ST_D AS 'State'
ACROSS-TOTAL AS 'Product Total' RECOMPUTE
ACROSS ST AS ''

ACROSS STCD AS 'Store'
ACROSS-TOTAL AS 'State Total' RECOMPUTE
WHERE ST EQ 'CA' OR 'CT';
ON TABLE COLUMN-TOTAL RECOMPUTE
END
-EXIT


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Virtuoso
posted Hide Post
Martin

You can use the following:
  
TABLE FILE GGSALES
SUM UNITS
DOLLARS
COMPUTE PCT/D6.2% = UNITS/DOLLARS * 100; AS 'PCT'
BY PRODUCT 

ACROSS ST AS 'State' COLUMNS CT AND CA
ACROSS-TOTAL AS 'Product Total' RECOMPUTE

ACROSS STCD AS 'Store'
ACROSS-TOTAL AS 'State Total' RECOMPUTE
WHERE ST EQ 'CA' OR 'CT';
ON TABLE COLUMN-TOTAL RECOMPUTE
END


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

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] ROW-TOTAL doesn't RECOMPUTE with ACROSS

Copyright © 1996-2020 Information Builders