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     [SOLVED]counting records

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[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, 2008Report 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, 2004Report 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, 2010Report 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, 2008Report 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, 2007Report 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: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report 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, 2008Report 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, 2008Report 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, 2008Report 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     [SOLVED]counting records

Copyright © 1996-2020 Information Builders