April 29, 2008, 10:39 PM
Maria Tanhow 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
April 30, 2008, 02:24 AM
Tony AYou might need to preprocess your data counting the event occurences and then use BY HIGHEST n [count_fieldname].
T
April 30, 2008, 04:52 AM
YuutaHow 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~
April 30, 2008, 05:35 AM
FrankDutchSearch for the functionality of "RANKED" here on focalpoint and you will find many examples on how this can be done.
April 30, 2008, 09:50 AM
GrEaT_DeBaTeMaria,
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
""
May 02, 2008, 01:50 PM
cburttMaria,
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
May 04, 2008, 07:23 AM
Danny-SRLMaria,
Could this help you?
TABLE FILE WEBFOCUSASAPVIEW2
SUM CNT.REPORTID AS '# of report'
BY HIGHEST 6 TOTAL CNT.REPORTID NOPRINT
BY EVENTDESC AS 'Event'