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     [CLOSED]Column Total on across

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]Column Total on across
 Login/Join
 
Platinum Member
posted
Hi All,
I`m trying to add totals to the my across report, some how I`m not successful with the following example code.
Any help will be appreciated.

 SET BYDISPLAY 	= ON
DEFINE FILE CAR
DUMMY/A1 = ' ';
END

TABLE FILE CAR
SUM
DEALER_COST  OVER
RETAIL_COST  OVER 
SALES 
ACROSS CAR AS ''
BY DUMMY NOPRINT
ON DUMMY RECAP
DUM/A1 = DUMMY;
    ACT/D20.2 =DEALER_COST+RETAIL_COST+ SALES;
	    ACT1/D20.2 = DEALER_COST+RETAIL_COST+ SALES;
ON DUMMY SUBFOOT
"Total:<ACT<ACT1"
WHERE COUNTRY EQ 'ENGLAND'
END
-EXIT 

This message has been edited. Last edited by: <Emily McAllister>,


WebFocus-8/Windows/HTML, PDF, EXCEL
 
Posts: 106 | Registered: September 20, 2010Report This Post
Virtuoso
posted Hide Post
Is that what you're looking for ?
 SET BYDISPLAY 	= ON
DEFINE FILE CAR
DUMMY/A1 = ' ';
END

TABLE FILE CAR
SUM
DEALER_COST  OVER
RETAIL_COST  OVER 
SALES 
ACROSS CAR AS ''
ACROSS-TOTAL
BY DUMMY NOPRINT

ON DUMMY RECAP
DUM/A1 = DUMMY;
    ACT/D20.2 =DEALER_COST+RETAIL_COST+ SALES;
	    ACT1/D20.2 = DEALER_COST+RETAIL_COST+ SALES;
ON DUMMY SUBFOOT
"Total:<ACT<ACT1"
WHERE COUNTRY EQ 'ENGLAND'
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
Platinum Member
posted Hide Post
quote:
ACROSS CAR AS ''
ACROSS-TOTAL

Hi Martin,
Thanks for reply, I want column total, like total for Dealer cost, Retail cost, Sales, not row totals, Please let me know how can I achieve column totals while I`m doing across.

Thanks,


WebFocus-8/Windows/HTML, PDF, EXCEL
 
Posts: 106 | Registered: September 20, 2010Report This Post
Virtuoso
posted Hide Post
With both totals : column and row
TABLE FILE CAR
SUM DEALER_COST
    RETAIL_COST
    SALES 
BY COUNTRY
ACROSS CAR AS ''
ACROSS-TOTAL
ON TABLE COLUMN-TOTAL AS 'Total '
END


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
Platinum Member
posted Hide Post
Hi Martin,
Thanks again for your reply,
I'm using OVER for transposing the data
 SET BYDISPLAY 	= ON
TABLE FILE CAR
SUM DEALER_COST OVER
    RETAIL_COST OVER
    SALES 
BY COUNTRY NOPRINT
ACROSS CAR AS ''
ACROSS-TOTAL
WHERE COUNTRY IN('ENGLAND','JAPAN')
ON TABLE COLUMN-TOTAL AS 'Total '
END 


not able to get column totals

Thanks,


WebFocus-8/Windows/HTML, PDF, EXCEL
 
Posts: 106 | Registered: September 20, 2010Report This Post
Virtuoso
posted Hide Post
You do have the total, it's just that your data did not create a different total than the detailed data.

Here a sample:
SET BYDISPLAY 	= ON
DEFINE FILE CAR
NCOUNTRY /A10 = DECODE COUNTRY ('FRANCE' 'EAST' 'ITALY' 'EAST' 'ENGLAND' 'EAST' 'W GERMANY' 'WEST' 'JAPAN' 'WEST'); 
END
TABLE FILE CAR
SUM DEALER_COST OVER
    RETAIL_COST OVER
    SALES 
BY COUNTRY
ACROSS NCOUNTRY AS ''
ACROSS-TOTAL
ON TABLE COLUMN-TOTAL AS 'Total '
END


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
Platinum Member
posted Hide Post
Hi Martin,
May be I`m not explaining properly, I need column totals not row totals, your code is not populating column totals, just an empty row.
 
SET BYDISPLAY 	= ON
DEFINE FILE CAR
END
TABLE FILE CAR
SUM DEALER_COST OVER
    RETAIL_COST OVER
    SALES 
BY COUNTRY NOPRINT
ACROSS COUNTRY AS ''
ON TABLE COLUMN-TOTAL AS 'Total '
END 

Thanks,


WebFocus-8/Windows/HTML, PDF, EXCEL
 
Posts: 106 | Registered: September 20, 2010Report This Post
Virtuoso
posted Hide Post
My code display Column AND Row total.
There is no empty row, the total is displayed "Under" the word "Total" because you are using a NOPRINT for the value (COUNTRY) which as the grand total for.

This one display only Column total and I've DEFINEd a field that generate a Column total which is the total of several values so you can see a different result than in your sample code:
SET BYDISPLAY 	= ON
DEFINE FILE CAR
NCOUNTRY /A10 = DECODE COUNTRY ('FRANCE' 'EAST' 'ITALY' 'EAST' 'ENGLAND' 'EAST' 'W GERMANY' 'WEST' 'JAPAN' 'WEST'); 
END
TABLE FILE CAR
SUM DEALER_COST OVER
    RETAIL_COST OVER
    SALES 
BY COUNTRY
ACROSS NCOUNTRY AS ''
-*ACROSS-TOTAL
ON TABLE COLUMN-TOTAL AS 'Total '
END


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
Platinum Member
posted Hide Post
Hi Martin,
you are right, but I want grand total for EAST (in your case), but this is giving total by Dealer_cost, Retail_cost and Sales individually, hope you got my issue.

Thnaks,


WebFocus-8/Windows/HTML, PDF, EXCEL
 
Posts: 106 | Registered: September 20, 2010Report This Post
Virtuoso
posted Hide Post
Because of the usage of OVER the Total bottom line is given for each SUM values

By adding a COMPUTEd field it gives you the total for the three SUM fields but it also be included for each break down (COUNTRY):
SET BYDISPLAY 	= ON
DEFINE FILE CAR
NCOUNTRY /A10 = DECODE COUNTRY ('FRANCE' 'EAST' 'ITALY' 'EAST' 'ENGLAND' 'EAST' 'W GERMANY' 'WEST' 'JAPAN' 'WEST'); 
END
TABLE FILE CAR
SUM DEALER_COST OVER
    RETAIL_COST OVER
    SALES       OVER
    COMPUTE GTOT/P10.2C = DEALER_COST + RETAIL_COST + SALES; AS 'Region Total'
BY COUNTRY
ACROSS NCOUNTRY AS ''
-*ACROSS-TOTAL
ON TABLE COLUMN-TOTAL AS 'Total '
END


Then following all sample code provided, I think that you may be able to play around and find out how to accomplish your request.

Otherwise remove the OVER and it will gives you another look which make a lot of sense according to me
SET BYDISPLAY 	= ON
DEFINE FILE CAR
NCOUNTRY /A10 = DECODE COUNTRY ('FRANCE' 'EAST' 'ITALY' 'EAST' 'ENGLAND' 'EAST' 'W GERMANY' 'WEST' 'JAPAN' 'WEST'); 
END
TABLE FILE CAR
SUM DEALER_COST
    RETAIL_COST
    SALES
    COMPUTE GTOT/P10.2C = DEALER_COST + RETAIL_COST + SALES; AS 'Region Total'
BY COUNTRY
ACROSS NCOUNTRY AS ''
-*ACROSS-TOTAL
ON TABLE COLUMN-TOTAL AS 'Total '
END


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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Column Total on across

Copyright © 1996-2020 Information Builders