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] SUM of AVG count Issue.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] SUM of AVG count Issue.
 Login/Join
 
Member
posted
There is a defined column for Average of counts ("counts" is defined column having rownumber).
As per the requirement, need to do SUM(AVE.COUNT) based on BY field.

When I do SUM(Count), its coming fine but not able to do sum on AVE.COUNT, is there any method to acheive sum up the AVG of Counts.

Could you please let me know , how to handle this ??

Thanks,
Senthil

This message has been edited. Last edited by: <Kathryn Henning>,


8.0.04 Version
Unix
HTML,Excel
 
Posts: 5 | Registered: January 27, 2014Report This Post
Master
posted Hide Post
Senthill,

I think I know what you mean, but could post an example of what you're trying?

( You could always add an extra Row-counter and devide the sum by the number of rows... )

e.g.
DEFINE FILE CAR
	ROWCOUNTER/I11 = 1;
END

TABLE FILE CAR
	SUM	SALES	NOPRINT
		ROWCOUNTER	NOPRINT
		COMPUTE AVG_SALES/D12.2 = SALES / ROWCOUNTER; 
	BY  COUNTRY
END


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Member
posted Hide Post
Dave ,
Here is the sample code,
DEFINE FILE CAR
Count/I5=1;
MDEL_LEN/A50=CAR.CARREC.MODEL ||EDIT(CAR.SPECS.LENGTH);
END
TABLE FILE CAR
SUM
CAR.BODY.SALES
AVE.Count AS 'AVE,Count'
BY LOWEST CAR.ORIGIN.COUNTRY
BY LOWEST CAR.COMP.CAR
BY CAR.SPECS.MDEL_LEN NOPRINT
ACROSS LOWEST CAR.BODY.SEATS
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE ROW-TOTAL AS 'TOTAL'
ON TABLE COLUMN-TOTAL AS 'TOTAL'
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
TYPE=DATA,
COLUMN=N4,
BACKCOLOR='WHITE',
$
TYPE=ACROSSVALUE,
ACROSS=1,
BACKCOLOR='WHITE',
$
TYPE=REPORT,
COLUMN=N3,
SQUEEZE=1.416667,
$
ENDSTYLE
END

Output Is :
SEATS
2 4 5 TOTAL
"
COUNTRY" "
CAR" "
SALES" "AVE
Count" "
SALES" "AVE
Count" "
SALES" "AVE
Count" "
SALES" "AVE
Count"
ENGLAND JAGUAR 0 1 0 1
12000 1 12000 1
JENSEN 0 1 0 1
TRIUMPH 0 1 0 1
FRANCE PEUGEOT 0 1 0 1
ITALY ALFA ROMEO 4800 1 4800 1
12400 1 12400 1
13000 1 13000 1
MASERATI 0 1 0 1
JAPAN DATSUN 43000 1 43000 1
TOYOTA 35030 1 35030 1
W GERMANY AUDI 7800 1 7800 1
BMW 8900 1 8900 1
8950 1 8950 1
18940 1 18940 1
14000 1 14000 1
15600 1 15600 1
14000 1 14000 1
TOTAL 25400 5 91730 5 91290 8 208420 18


But Expected output is :

SEATS
2 4 5 TOTAL
"
COUNTRY" "
CAR" "
SALES" "AVE
Count" "
SALES" "AVE
Count" "
SALES" "AVE
Count" "
SALES" "AVE
Count"
ENGLAND JAGUAR 0 1 1 12000 1 12000 1
JENSEN 0 1 0 1
TRIUMPH 0 1 0 1
FRANCE PEUGEOT 0 1 0 1
ITALY ALFA ROMEO 25400 3 4800 1 30200 3
MASERATI 0 1 0 1
JAPAN DATSUN 43000 1 43000 1
TOYOTA 35030 1 35030 1
W GERMANY AUDI 7800 1 7800 1
BMW 8900 1 71490 5 80390 6
TOTAL 25400 5 91730 5 91290 8 208420 18


Can help me to archeive this.


Thanks,
Senthil


8.0.04 Version
Unix
HTML,Excel
 
Posts: 5 | Registered: January 27, 2014Report This Post
Master
posted Hide Post
Like this?

DEFINE FILE CAR
Count/I5=1;
MDEL_LEN/A50=CAR.CARREC.MODEL ||EDIT(CAR.SPECS.LENGTH);
END

TABLE FILE CAR
SUM 
CAR.BODY.SALES
Count
-*AVE.Count AS 'AVE,Count'
BY LOWEST CAR.ORIGIN.COUNTRY
BY LOWEST CAR.COMP.CAR
-*BY CAR.SPECS.MDEL_LEN  
ACROSS LOWEST CAR.BODY.SEATS
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE ROW-TOTAL AS 'TOTAL'
ON TABLE COLUMN-TOTAL AS 'TOTAL'
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
TYPE=DATA,
COLUMN=N4,
BACKCOLOR='WHITE',
$
TYPE=ACROSSVALUE,
ACROSS=1,
BACKCOLOR='WHITE',
$
TYPE=REPORT,
COLUMN=N3,
SQUEEZE=1.416667,
$
ENDSTYLE
END


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Member
posted Hide Post
quote:
BY CAR.SPECS.MDEL_LEN

Thanks for your reply ,

I need to include the commented BY field as well
to retrieve the required results

CAR.SPECS.MDEL_LEN

PLease suggest how to acheive to get it with the BY field ??

Thanks,
Senthil.


8.0.04 Version
Unix
HTML,Excel
 
Posts: 5 | Registered: January 27, 2014Report This Post
Master
posted Hide Post
Senthill,

That will change the outcome of the SUM for each row. Even with NOPRINT.

If you need the SUM values on each row independent of the commented By-Field you might want to add it later ( with MATCH for example ) or use sort-groups.

G'luck.

( I'm still trying to understand want the desired functionality is ).


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report 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] SUM of AVG count Issue.

Copyright © 1996-2020 Information Builders