Focal Point
how to count the number

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

April 29, 2008, 10:39 PM
Maria Tan
how to count the number
Hi;

In my report, i need to get the top 6 frequenctly happened event based on the report number submitted? How can i do that?

TABLE FILE WEBFOCUSASAPVIEW2
COUNT REPORTID AS '# of report'
BY EVENTDESC AS 'Event'
HEADING
"Event Table"
FOOTING
""

Thanks
------------------------------------------------
Server: 7.6.4 on Window 2003
Client: 7.1.1 on HP-UX WebLogic 8.1


====================
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
April 30, 2008, 02:24 AM
Tony A
You might need to preprocess your data counting the event occurences and then use BY HIGHEST n [count_fieldname].

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
April 30, 2008, 04:52 AM
Yuuta
How about this,
Create a new field(Define/Compute) and fill it with '1' then do SUM by EVENTDESC. That should add up all the '1' and gave you a count on how many time an event occured.

DEFINE FILE WEBFOCUSASAPVIEW2
  STRTEMPFLAG/I5 = 1;
END

TABLE FILE WEBFOCUSASAPVIEW2
  SUM
    STRTEMPFLAG
  BY EVENTDESC
END


hope that helps, cheers~


7.1.3 on XP into HTML, Excel, PDF
April 30, 2008, 05:22 AM
Tony A
Exactly, as in preprocess your data counting the event occurences.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
April 30, 2008, 05:35 AM
FrankDutch
Search for the functionality of "RANKED" here on focalpoint and you will find many examples on how this can be done.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

April 30, 2008, 09:50 AM
GrEaT_DeBaTe
Maria,
Try this:

TABLE FILE WEBFOCUSASAPVIEW2
COUNT REPORTID AS '# of report'
BY EVENTDESC AS 'Event'

RANKED AS 'RANK' BY TOTAL HIGHEST 6 EVENTDESC NOPRINT

HEADING
"Event Table"
FOOTING
""


7.6.4
windows
Excel2k and HTML.
May 02, 2008, 01:50 PM
cburtt
Maria,

Yuuta's comment is well taken.

If you base your frequency analysis on the sum of a DEFINED field, then you can use IF... statements inside DEFINE/END and COMPUTEs inside the TABLE_FILE/END to set the summed field to either '0' or '1'./ This lets you analyze extremely complex relationships between any two or more columns of data.

Counting the settings of hidden 'flag' fields is a classic programming technique.

Chris


WIN/2K running WF 7.6.4
Development via DevStudio 7.6.4, MRE, TextEditor.
Data is Oracle, MS-SQL.
May 04, 2008, 07:23 AM
Danny-SRL
Maria,
Could this help you?
  
TABLE FILE WEBFOCUSASAPVIEW2
SUM CNT.REPORTID AS '# of report'
BY HIGHEST 6 TOTAL CNT.REPORTID NOPRINT
BY EVENTDESC AS 'Event'



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