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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Using SUM
 Login/Join
 
Silver Member
posted
Hi,

I am trying to get average using SUM verb as mentioned below code.

TABLE FILE CAR
SUM
AVE.SALES AS SAL1
BY
COUNTRY
END

TABLE FILE CAR
SUM
AVE.SALES AS SAL2
CNT.SALES
BY
COUNTRY
END

As a result I expect SAL1 and SAL2 should have same data in it but its not the case.

How can I achieve desire o/p using SUM?


WF dev version - 7.6.x
 
Posts: 29 | Registered: February 15, 2006Report This Post
Guru
posted Hide Post
In 7.1.3 this works fine both are the same value. I remember having any like this in older versions, I think the problem was the records that had zero were not being used. ie Sales has the value of zero.

Are you getting results like the following:
Option 1:
		SALES	COUNT	AVE
ENGLAND		12000	4	3000
FRANCE		0	1	0
ITALY		30200	4	7550
JAPAN		78030	2	39015
W GERMANY	         88190	7	12598.57143
TOTAL		208420	18	11578.88889


Option 2:
		SALES	COUNT	AVE
ENGLAND		12000	1	12000
FRANCE		0	0	0
ITALY		30200	3	10066.66667
JAPAN		78030	2	39015
W GERMANY	         88190	7	12598.57143
TOTAL		208420	13	16032.30769
 
Posts: 406 | Location: Canada | Registered: May 31, 2004Report This Post
Expert
posted Hide Post
 
COUNTRY    SAL1 
ENGLAND    3000 
FRANCE        0 
ITALY      7550 
JAPAN     39015 
W GERMANY 12598 

COUNTRY   SAL2  SALES
                COUNT 
ENGLAND    3000 4 
FRANCE        0 1 
ITALY      7550 4 
JAPAN     39015 2 
W GERMANY 12598 7 

i get exactly the same answers




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Silver Member
posted Hide Post
I get below output.

COUNTRY SAL1
======= =========
ENGLAND 3000
FRANCE 0
ITALY 7550
JAPAN 39015
W GERMANY 12598

PAGE 1
COUNTRY SAL2 SALES.COUNT
======= ==== =======
ENGLAND 3750 16
FRANCE 0 3
ITALY 0 4
JAPAN 39015 4
W GERMANY 7800 3

I am using web focus 7.1.1

Rgds.


WF dev version - 7.6.x
 
Posts: 29 | Registered: February 15, 2006Report This Post
Guru
posted Hide Post
I copied and pasted the two TABLE files into one focexec and they both returned the same answers for the AVE. This was running in Dev Studio R711.

Are you running them both from the same focexec.?
If not, can you try it?

It looks like something else is coming into play.


ttfn, kp


Access to most releases from R52x, on multiple platforms.
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Report This Post
Expert
posted Hide Post
ALso place -

? FILE CAR

as the final line of the fex and post the final comment from the page source. It should look something like -
<!--     
    
  0 STATUS OF FOCUS FILE: D:\wfdev\ibi\apps\...\car.foc ON 05/24/2006 AT 08.49.33
  0                 ACTIVE  DELETED    DATE OF    TIME OF    LAST TRANS
    SEGNAME         COUNT   COUNT      LAST CHG   LAST CHG     NUMBER
    
    ORIGIN             5             01/31/2005   10.34.23       53
    COMP              10             01/31/2005   10.34.23       53
    CARREC            18             01/31/2005   10.34.23       53
    BODY              18             11/25/2005   16.25.32         
    SPECS             18             01/31/2005   10.34.23       53
    WARANT             8             01/31/2005   10.34.23       53
    EQUIP             25             01/31/2005   10.34.23       53
    *INDEXES*
    COUNTRY                          01/31/2005   10.34.23       53
  0 TOTAL SEGS       102             
    TOTAL CHAR      3988
    TOTAL PAGES        8
    LAST CHANGE                      11/25/2005   16.25.32         
    
 -->


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Silver Member
posted Hide Post
Hi,

I got below info -

0 STATUS OF FOCUS FILE: C:\ibi\apps\baseapp\car.foc ON 05/24/2006 AT 14.21.41
0 ACTIVE DELETED DATE OF TIME OF LAST TRANS
SEGNAME COUNT COUNT LAST CHG LAST CHG NUMBER
ORIGIN 5 05/08/2006 12.25.53 53
COMP 10 05/08/2006 12.25.53 53
CARREC 18 05/08/2006 12.25.53 53
BODY 18 05/08/2006 12.25.53 53
SPECS 18 05/08/2006 12.25.53 53
WARANT 8 05/08/2006 12.25.53 53
EQUIP 25 05/08/2006 12.25.53 53
*INDEXES*
COUNTRY 05/08/2006 12.25.53 53
0 TOTAL SEGS 102
TOTAL CHAR 3988
TOTAL PAGES 8
LAST CHANGE 05/08/2006 12.25.53 53


I am running both of them from the same focexec.

Regards,


WF dev version - 7.6.x
 
Posts: 29 | Registered: February 15, 2006Report This Post
Expert
posted Hide Post
OK, so it looks as though your CAR file is intact with no modifications or updates. But as Karen has said, something else is coming into play.

Add

? JOIN
? SET

and again post the output but this time use the [ code ] and [ /code ] tags around your output so that it is easier to read Smiler (leave the spaces in the code tags out).



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Silver Member
posted Hide Post
Hi Tony, I am just trying to use code ... not sure if this is the correct way to use it.

  0 NO JOINS CURRENTLY IN EFFECT

 PARAMETER SETTINGS
 ALL.                OFF    FOCALLOC            OFF    PRINTPLUS           OFF
 ASNAMES           FOCUS    FOCSTACK SIZE         8    QUALCHAR              .
 AUTOINDEX            ON    FORMFEED          ASCII    QUALTITLES          OFF
 AUTOPATH             ON    HDAY                       REBUILDMSG         1000
 BINS                 64    HIPERFOCUS          OFF    RECAP-COUNT         OFF
 BLKCALC             NEW    HOLDATTRS         FOCUS    SAVEMATRIX          OFF
 BUSDAYS         _MTWTF_    HOLDLIST            ALL    SCREEN              OFF
 BYPANELING          OFF    HOLDSTAT            OFF    SHADOW PAGE         OFF
 CACHE                 0    HOTMENU             OFF    SPACES             AUTO
 CARTESIAN           OFF    IBMLE               OFF    SQLENGINE
 CDN                 OFF    INDEX TYPE          NEW    SUMPREFIX           LST
 COLUMNSCROLL        OFF    LANGUAGE      AMENGLISH    TCPIPINT            OFF
 DATEDISPLAY         OFF    LINES/PAGE           66    TEMP DISK C:\ibi\DEVS..
 DATEFNS              ON    LINES/PRINT          57    TERMINAL        IBM3270
 DATETIME  STARTUP/RESET    MESSAGE              ON    TESTDATE          TODAY
 DEFCENT              19    MODE              WINNT    TITLES               ON
 EMPTYREPORT         OFF    MORE                OFF    VIEWNAMESIZE         60
 EXCELRELEASE       2000    MULTIPATH      COMPOUND    WIDTH               130
 EXL2KLANG             1    NODATA                .    WINPFKEY            OLD
 EXTAGGR              ON    PAGE-NUM             ON    XFBINS     16 (passive)
 EXTHOLD              ON    PANEL                 0    XFC                  ON
 EXTSORT             OFF    PAUSE               OFF    XRETRIEVAL           ON
 FIELDNAME           NEW    POOL                OFF    YRTHRESH              0
 FOC2GIGDB            ON    PRINT            ONLINE
 


WF dev version - 7.6.x
 
Posts: 29 | Registered: February 15, 2006Report This Post
Expert
posted Hide Post
Apart from the fact that you are running in Dev Studio standalone server there is no difference to what I (and most others I assume) are running. I suugest you call this in.

By the way, spot on with the code tagging Smiler

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders