Focal Point
Top 10 report?

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

August 23, 2007, 01:30 PM
Jason K.
Top 10 report?
I'm trying to create a report of the top 10 salesman by their sales amounts.

I have the sales amount as the only by field, and it does show the rows in order like one would expect, but it misses quite a few salesman.

I have set a RECORDLIMIT EQ 10, and when i take that off I get a completely different arrangement, and the top 10 becomes very different.

Is a recordlimit the same as a read limit somehow?


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
August 23, 2007, 01:37 PM
k.lane
Why not :

BY HIGHEST 10 SALES_AMOUNT

Ken


Prod - WF 7.6.4 Unix/Solaris - Self-Service, BI Dashboard, MRE
Dev - WF 7.6.4 Unix/Solaris - Self-Service, BI Dashboard, MRE
Databases: Oracle 10g, SQL Server 2000, DB2.
August 23, 2007, 01:38 PM
Leah
RECORDLIMIT - limit the number of records retrieved that match the selection criteria

READLIMIT - limit the number of records 'looked' at for retreival to the number specified, not related to actually matching selection.

Of course as some would point out this is documented in help text.


Leah
August 23, 2007, 01:41 PM
Albert Ceccucci
No recordlimit and readlimit are not the same.

Recordlimit controls output, so if 10 is the recordlimit then only 10 records will be reported (after filtering is performed) Readlimit controls the number of reads performed (regardless of filtering).

In order to accomplish what you'd like try the following:

TABLE FILE XXX
SUM AMT
BY EMP
ON TABLE HOLD
END

TABLE FILE HOLD
PRINT EMP
BY HIGHEST 10 AMT
END


Regards
August 23, 2007, 01:51 PM
Jason K.
in order to troubleshoot this, I added a read limit.

I have a read limit of 1000000 and a record limit of 10, so it should be showing the top 10 of the 1000000 records it's records it's reading.

WHERE READLIMIT EQ 15000000
with no recordlimit returns
10,669.17
7,016.58
3,649.05
3,263.42
3,064.00
2,693.66
2,433.86
2,415.91
2,401.57
.... and quite a few more.

but, when I add
WHERE READLIMIT EQ 15000000;
WHERE RECORDLIMIT EQ 10;
I get this...
22.48
18.04
0
0
0
0
0
-14.49
-41.66
-295.25

so how does one create a top 10 report? I used to call this a TOP N report, but when I search the webfocus website I don't find anything of consequence when I search for TOP N or top N reports.

Thanks!

This message has been edited. Last edited by: Jason K.,


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
August 23, 2007, 01:59 PM
Jason K.
sorry, didn't see k.lane's suggestion had a 10 in the by command.

That works perfectly!


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.