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] TOTAL ON BY FIELDS WITH ACROSS

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] TOTAL ON BY FIELDS WITH ACROSS
 Login/Join
 
Gold member
posted
Hello,

I need to have the total for two fields which are by fields. How can I do this ?
Here is the code, the fields are TOT_PAS and TOT_FAC.
[DEFINE FILE TMP1
TOT_PAS/D6.2 = TOTAL_PAS/60;
TOT_FAC/D6.2 = TOTAL_FAC/60;
END

TABLE FILE TMP1
SUM
COMPUTE HH_PAS/D6.2 = MINUTES_PAS/60; AS 'Tps 1'
COMPUTE HH_FAC/D6.2 = MINUTES_FAC/60; AS 'Tps 2'

BY JOUR NOPRINT
BY PERIODE AS 'Date'
BY TOT_PAS AS 'Tot 1,Jour'
BY TOT_FAC AS 'Tot 2,Jour'
BY COCLI AS 'Client'
ACROSS CTTYPE AS 'Tâches' NOPRINT
ACROSS CYLIB AS 'Détail des Tâches'
]
Thanks for help.
Catherine

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


7.7.02 (Html, Excel, Ahtml, Pdf,Graph,.....)
OS400 V5R3, V5R4
Windows 2000/2003/2007/2010
 
Posts: 68 | Location: France | Registered: February 27, 2008Report This Post
Virtuoso
posted Hide Post
Something like this should do the trick:
DEFINE FILE TMP1
 DUMMY/I1 = 0;
END
TABLE FILE TMP1
SUM COMPUTE TOT_PAS/D6.2 = TOTAL_PAS/60;
    COMPUTE TOT_FAC/D6.2 = TOTAL_FAC/60;
BY DUMMY
ON TABLE HOLD AS TMP2 FORMAT FOCUS INDEX DUMMY
END
-RUN

JOIN
 DUMMY WITH JOUR IN TMP1 TO
 DUMMY IN TMP2 AS J0
END
DEFINE FILE TMP1
 DUMMY/I1 WITH JOUR = 0;
END
TABLE FILE TMP1
SUM
 COMPUTE HH_PAS/D6.2 = MINUTES_PAS/60; AS 'Tps 1'
 COMPUTE HH_FAC/D6.2 = MINUTES_FAC/60; AS 'Tps 2'

BY JOUR NOPRINT
BY PERIODE AS 'Date'
BY TOT_PAS AS 'Tot 1,Jour'
BY TOT_FAC AS 'Tot 2,Jour'
BY COCLI AS 'Client'
ACROSS CTTYPE AS 'Tâches' NOPRINT
ACROSS CYLIB AS 'Détail des Tâches'
END


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
Cati,

The problem with totalling BY fields is twofold:
1. They cannot be totalled directly as they are not verb objects
2. Since you are sorting on them, you probably want to total the distinct values.

So I don't see any other possibility than having more than one pass and also having to use some &variables. Here is what I came up with:
  
-* File CatiFrance5.fex
SET HOLDLIST=PRINTONLY
TABLE FILE CAR
BY COUNTRY
BY SEATS
ON TABLE HOLD
END
TABLE FILE HOLD
SUM SEATS
ON TABLE SAVE
END
-RUN
-READ SAVE,&TSEATS
-RUN
TABLE FILE CAR
SUM RCOST DCOST
BY COUNTRY
BY SEATS
ON TABLE SUBFOOT
"Total<+0 &TSEATS<TOT.RCOST<TOT.DCOST"
ON TABLE SET STYLE *
TYPE=TABFOOTING, HEADALIGN=BODY, JUSTIFY=RIGHT, $
TYPE=TABFOOTING, ITEM=1, JUSTIFY=LEFT, $
ENDSTYLE
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     [CLOSED] TOTAL ON BY FIELDS WITH ACROSS

Copyright © 1996-2020 Information Builders