Focal Point
[CLOSED] Row count with aggrigation function

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1617014876

September 15, 2015, 01:04 AM
User1
[CLOSED] Row count with aggrigation function
Hi All,

In the below code, I need to display the total count at the end.

Can anyone please suggest..!!


ENGINE DB2 SET DEFAULT_CONNECTION CNAME
-SET ECHO = ALL;
-DEFAULT &FROM_DATE='2015/07/21'
-DEFAULT &TO_DATE='2015/08/21'

SET ASNAMES = ON
SQL DB2 EX SYSPROC.TEST('&FROM_DATE','&TO_DATE')@
;
TABLE FILE SQLOUT
ON TABLE SUBHEAD
" STOP PAYMENT COUNT BY CHANNEL"
SUM CNT.STOP_PYMT_CHANNEL AS COUNT_STOP_PYMT
BY STOP_PYMT_CHANNEL
END

Thanks,
User1

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


WebFOCUS 8
Windows, All Outputs
September 15, 2015, 04:41 AM
Dave
This should do the trick:

TABLE FILE SQLOUT
ON TABLE SUBHEAD
" STOP PAYMENT COUNT BY CHANNEL"
SUM CNT.STOP_PYMT_CHANNEL AS COUNT_STOP_PYMT

COMPUTE AGGR_COUNT/D12 = AGGR_COUNT + CNT.STOP_PYMT_CHANNEL;

BY STOP_PYMT_CHANNEL
END



_____________________
WF: 8.0.0.9 > going 8.2.0.5
September 15, 2015, 11:04 AM
User1
Hi ,

Thanks for this

But I need to provide the sum of count at the footer side with single value.

For ex,
Total count= 100

Thanks ,
User1


WebFOCUS 8
Windows, All Outputs
September 15, 2015, 08:25 PM
StuBouyer
COLUMN-TOTAL ?

I think you need to read some manual but more importantly talk to your management about some WebFOCUS training.

You obviously know what you want to do but are just missing the knowledge of where to look or what tools will allow you to get things done.

Including Totals and Subtotals

or possibly Summing and Counting Values from Manipulating Display Fields with Prefix Operators

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


WebFOCUS 8.2.03 (8.2.06 in testing)
September 16, 2015, 02:34 AM
Danny-SRL
Hi User1,
Take a page out of Stu's book: training is paramount. Also you will learn that WebFOCUS can provide many possible different solutions.
Here is one based upon Dave's:
  
TABLE FILE CAR
ON TABLE SUBHEAD 
"SEATS COUNT"
SUM CNT.SEATS
COMPUTE TOTCNTSEATS/I5=LAST TOTCNTSEATS + CNT.SEATS; NOPRINT
BY SEATS
ON TABLE SUBFOOT
"TOTAL SEATS COUNT=<TOTCNTSEATS "
END


And here is another:
  
TABLE FILE CAR
SUM CNT.SEATS
BY SEATS
ON TABLE RECAP
TOTCNTSEATS/I5=C1;
ON TABLE SUBHEAD 
"SEATS COUNT"
ON TABLE SUBFOOT
"TOTAL SEATS COUNT=<TOTCNTSEATS"
END



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