Focal Point
[CLOSED] How to out the count of reords in page heading

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

September 02, 2009, 07:05 PM
Maria Tan
[CLOSED] How to out the count of reords in page heading
Hey,

I have a sql report.

I want to

1: get the count of records based on ACCT_USER_ID

2: put the number into page heading

How can i do that

ENGINE SQLORA SET DEFAULT_CONNECTION TEST

SQL SQLORA PREPARE SQLOUT FOR

select * from
);

END
TABLE FILE SQLOUT
PRINT
ACCT_LAST_NAME AS 'Last Name'
ACCT_FIRST_NAME AS 'First Name'
BY ACCT_USER_ID

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


====================
Production: WebFOCUS 7.1.1 on Window 2003
WebFOCUS 7.1.1 Client on HP-UX on WebLOGIC 8.1 sp4
Dev: WebFOCUS 7.6.4 on Window 2003
WebFOCUS 7.1.1 Client on HP-UX on WebLogic 8.1 sp4
September 02, 2009, 10:52 PM
Doug
Check out / study up on the use of &LINES and / or &RECORDS...
September 03, 2009, 02:32 AM
Danny-SRL
Maria,

You can use a multi-set report:
  
-* File MariaTan3.fex
TABLE FILE CAR
SUM CNT.COUNTRY NOPRINT CNT.SALES NOPRINT
PRINT SALES 
BY COUNTRY
BY CAR
BY MODEL
HEADING
"Sales report for <CNT.COUNTRY Countries, <CNT.SALES Records"
END



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

September 03, 2009, 07:04 AM
Doug
Yep Danny, that'll work. I was thinking along the lines of:
select * from );
END
-RUN
TABLE FILE SQLOUT
...
HEADING
"There are &RECORDS / &LINES in this file."
...
Or something like that, seeing that those variables had known / usable values fronm the SQLOUT file...
September 03, 2009, 09:35 AM
Francis Mariani
You would like the "count of records based on ACCT_USER_ID"?

You could do it in the SQL statement, here's an example based on a DB2 table on my server:

SQL DB2
SELECT 
MIN(BASEL.TIME_D.TIME_DIM_KEY) AS TIME_DIM_KEY,
BASEL.TIME_D.CALENDAR_YEAR,
COUNT(*) AS COUNT
FROM BASEL.TIME_D
GROUP BY BASEL.TIME_D.CALENDAR_YEAR
ORDER BY BASEL.TIME_D.CALENDAR_YEAR
;
TABLE ON TABLE HOLD AS H001
END

TABLE FILE H001
PRINT TIME_DIM_KEY
BY CALENDAR_YEAR PAGE-BREAK
HEADING
"COUNT: <COUNT"
END


&LINES and &RECORDS are based on the whole report and not on the BY field.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server