Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]counting records
Go
New
Search
Notify
Tools
Reply
  
[SOLVED]counting records
 Login/Join
 
Platinum Member
posted
I have a counter(records) that I display in the footer of my report. it works fine there but when I move it to the header it gives me a count of 1 instead of 7263. I would prefer to display it in the header instead and am perplexed by why it renders correctly in the footer but not the header.

Any input is appreciated and suggestions as to why this behavior occurs would also be appreciated.

See my code below

TABLE FILE AS_ADMISSIONS_APPLICANT
COMPUTE CNTR/I6 = CNTR + 1; NOPRINT


HEADING
"&TOD"
"&DATE "
"&HEADING1"
"&HEADING2"
"Undergraduate Admissions Profile Report"
"For Term &TERM_CODE_KEY Student Type &STYP_CODE "
"Record Count '<'CNTR "
FOOTING
"Record Count '<'CNTR "

I had to add single quotes around the carats to get them to display in the message for some reason


Geoff Fish

This message has been edited. Last edited by: Geoff Fish,


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
 
Posts: 171 | Registered: April 28, 2008Reply With QuoteReport This Post
Silver Member
posted Hide Post
your compute for CNTR is off plus you need a direct operator on the CNTR field you are putting within the heading. here is what i came up with
TABLE FILE CAR
SUM COMPUTE CNTR/I6 = LAST CNTR + 1; NOPRINT
BY MODEL

HEADING
"&TOD"
"&DATE "
" "
" "
"Undergraduate Admissions Profile Report"
"For Term TERM_CODE_KEY Student Type STYP_CODE "
"Record Count <MAX.CNTR "
FOOTING
"Record Count <MAX.CNTR "
END  


7.7.04
Win2K3, Unix
Oracle 10G,SQL2K,XFOCUS,ESRI,BID,MRE,SELF-SERVICCE
 
Posts: 36 | Location: Melville,NY | Registered: August 09, 2004Reply With QuoteReport This Post
Gold member
posted Hide Post
DEFINE FILE CAR
  CNTR /I4 = 1;
END
TABLE FILE CAR
  SUM
    DEALER_COST
    RETAIL_COST
  BY COUNTRY
  BY CAR
  BY MODEL
  ON TABLE SET PAGE-NUM OFF
  HEADING
    "Heading - number of lines: <TOT.CNTR"
  FOOTING
    "Footing - number of lines : <TOT.CNTR"
END


WebFOCUS 7.6, 7.7
Windows, All Output formats
 
Posts: 90 | Location: Stuttgart | Registered: October 20, 2010Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Unfortunately neither solution will work for me because I am using a PRINT not SUM. maybe I should have shown more code.
This all gets passed to very nice HTML page

see below

DEFINE FILE AS_ADMISSIONS_APPLICANT
ADDRESS/A160=AS_ADMISSIONS_APPLICANT.AS_ADMISSIONS_APPLICANT.STREET1_LINE1 | ( '' || AS_ADMISSIONS_APPLICANT.AS_ADMISSIONS_APPLICANT.STREET1_LINE2 );
PHONE/A20=AS_ADMISSIONS_APPLICANT.AS_ADMISSIONS_APPLICANT.PHONE_AREA_CODE1 | ( '' || AS_ADMISSIONS_APPLICANT.AS_ADMISSIONS_APPLICANT.PHONE_NUMBER1 );

E_DATE_1/YYMD='&E_DATE';
B_DATE_1/YYMD='&B_DATE';
END
TABLE FILE AS_ADMISSIONS_APPLICANT
PRINT
&MEASURES.(AND(,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,)).Measures.
COMPUTE CNTR/I6 = LAST CNTR + 1; NOPRINT
BY &SORTA.(BY(,,,,,,,,,,,)).Sort1.
BY &SORTB.(BY(,,,,,,,,,,,)).Sort1.
BY &SORTC.(BY(,,,,,,,,,,,)).Sort1.
HEADING
"&TOD"
"&DATE "
"&HEADING1"
"&HEADING2"
"Undergraduate Admissions Profile Report"
"For Term &TERM_CODE_KEY Student Type &STYP_CODE "
"Record Count '<'TOT.CNTR "
FOOTING
"Record Count '<'CNTR "


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
 
Posts: 171 | Registered: April 28, 2008Reply With QuoteReport This Post
Virtuoso
posted Hide Post
I would expect MichaelBalle's example to work, even with PRINT.

What result are you getting?


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Reply With QuoteReport This Post
Expert
posted Hide Post
Right you are, about "I would expect MichaelBalle's example to work, even with PRINT."

Some people just use &RECORDS or &LINES from a previous extract... Just be sure use use a -RUN first...
 
Posts: 3135 | Location: Tennessee, Nashville area | Registered: February 23, 2005Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Your right it did work!

I did away with the compute and just used the define. Now TOT.CNTR works. thanks to all will mark closed


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
 
Posts: 171 | Registered: April 28, 2008Reply With QuoteReport This Post
Silver Member
posted Hide Post
MichaelBalle's example would work.

DEFINE CNTR = 1 : it is like creating an extra field named CNTR returned with each record in your dataset with a value of 1. If you sum up the values in thise column, you would get the number of records.
TOT.CNTR : this gives you the total of CNTR

A COMPUTE as in your original code is applied after the dataset is returned and thus, would not give you the correct number in the HEADING.

So try this ... remember to remove the COMPUTE CNTR statement.

DEFINE FILE AS_ADMISSIONS_APPLICANT
ADDRESS/A160=AS_ADMISSIONS_APPLICANT.AS_ADMISSIONS_APPLICANT.STREET1_LINE1 | ( '' || AS_ADMISSIONS_APPLICANT.AS_ADMISSIONS_APPLICANT.STREET1_LINE2 );
PHONE/A20=AS_ADMISSIONS_APPLICANT.AS_ADMISSIONS_APPLICANT.PHONE_AREA_CODE1 | ( '' || AS_ADMISSIONS_APPLICANT.AS_ADMISSIONS_APPLICANT.PHONE_NUMBER1 );

E_DATE_1/YYMD='&E_DATE';
B_DATE_1/YYMD='&B_DATE';

CNTR/I11=1;
END
TABLE FILE AS_ADMISSIONS_APPLICANT
PRINT
&MEASURES.(AND(,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,)).Measures.
BY &SORTA.(BY(,,,,,,,,,,,)).Sort1.
BY &SORTB.(BY(,,,,,,,,,,,)).Sort1.
BY &SORTC.(BY(,,,,,,,,,,,)).Sort1.
HEADING
"&TOD"
"&DATE "
"&HEADING1"
"&HEADING2"
"Undergraduate Admissions Profile Report"
"For Term &TERM_CODE_KEY Student Type &STYP_CODE "
"Record Count <TOT.CNTR "
FOOTING
"Record Count <CNTR "


Year(s) of experience in WebFOCUS: 5+. Using WebFOCUS 7.7.03 on Windows platform with Oracle/SQL Server.
 
Posts: 41 | Registered: September 08, 2008Reply With QuoteReport This Post
Platinum Member
posted Hide Post
thanks to everyone that responded

Big Grin
geoff


809 DevStudio, MRE, Report Caster , Report Library
Output: Excel PDF, HTML
 
Posts: 171 | Registered: April 28, 2008Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]counting records

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.