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]NUMBER OF RECORDS IN TABLE vs. LINES
Go
New
Search
Notify
Tools
Reply
  
[SOLVED]NUMBER OF RECORDS IN TABLE vs. LINES
 Login/Join
 
Gold member
posted
I have output that includes this:

 0 NUMBER OF RECORDS IN TABLE=       14  LINES=      9 


What's the difference between NUMBER OF RECORDS IN TABLE and LINES?

Thanks.

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 70 | Registered: April 27, 2012Reply With QuoteReport This Post
Virtuoso
posted Hide Post
I think &RECORDS is the variable the contains the number of records the request retrieved.  

&LINES is the variable that contains the number of lines in the answer set.

TABLE FILE CAR
SUM RCOST BY COUNTRY
END

will give you different LINES from
TABLE FILE CAR
PRINT RCOST BY COUNTRY
END

Same number retrieved but different number in the output.



WebFOCUS 8206, Unix, Windows
 
Posts: 1707 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Gold member
posted Hide Post
Okay, I think I see. So it seems the LINES value is determined by an aggregate function (SUM) in the query. In your first case, LINE will be the total number of COUNTRY, not the total number of records extracted by the query.

But what if your query has no aggregate function. Why would the numbers be different?

This example is similar to my actual code:

  
TABLE FILE ORDER_PAYMENTS
BY ORDER_KEY AS 'ORDER_NUMBER'
BY CUST_ID AS 'CUST_NUMBER'
WHERE ORDER_DT GE HADD((HGETC(8, 'HYYMDs')), 'DAY', -30, 8, 'HYYMDs');
WHERE INACTIVE_ACCT NE '1' OR INACTIVE_ACCT EQ MISSING;
WHERE ORDER_KEY IN &ORDER_KEY;
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS CUST_ORDERS FORMAT FOCUS INDEX ORDER_KEY
END



Note: &ORDER_KEY is a predetermined list of unique order numbers.

Thanks.


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 70 | Registered: April 27, 2012Reply With QuoteReport This Post
Virtuoso
posted Hide Post
You have a WHERE test. Try the same code without the three WHERE's and you'll probably get the same number of Lines as Records.


WebFOCUS 8206, Unix, Windows
 
Posts: 1707 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Gold member
posted Hide Post
You are correct. When I comment the WHERE lines, the numbers are the same.

So it appears, similar to an aggregate function, a WHERE clause will also determine the value of LINES.

Thanks, this helps a lot.


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 70 | Registered: April 27, 2012Reply With QuoteReport This Post
Platinum Member
posted Hide Post
It might being if WHERE not being translate to SQL. So answer set more big than final lines?

Kofi


Client Server 8.1.05: Apache; Tomcat;Windows Server 2012
Reporting Server 8.1.05; Oracle; MS SQL; Windows Server 2012
 
Posts: 103 | Registered: April 06, 2009Reply With QuoteReport This Post
Silver Member
posted Hide Post
Since there is no verb object included in the request, the output is aggregated by default, since each order number and customer number will only display one time, no matter how many records are extracted for that combination of values.


8009
Windows, HTML, AHTML, Excel
In FOCUS since 1983
 
Posts: 41 | Location: Charlotte, NC | Registered: January 06, 2012Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Remember that WebFocus is building an internal matrix. The Records value display the number of records returned from the source. From some sources such as a flat file that could be everything. From other sources such as SQL it is selected data from the source. The Lines value displays the matrix rows to be output as the results of any manipulation to the matrix. As already commented there are multiple reasons why the values may not be the same.


WebFOCUS 7.7.05 (Someday 8)
Windows 7, All Outputs
In Focus since 1983.
 
Posts: 103 | Registered: April 27, 2011Reply With QuoteReport This Post
Gold member
posted Hide Post
Thanks Kofi, Joni and Kevin.

I think I got it now:

NUMBER OF RECORDS IN TABLE = total # of records extracted from source

LINES = # number of lines outputted (based on how the extracted records are manipulated by the query)


I will keep this in consideration in the future.

Thanks again.


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 70 | Registered: April 27, 2012Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]NUMBER OF RECORDS IN TABLE vs. LINES

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