Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculating the mode
Message
From
27/06/2001 23:38:07
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australia
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00524498
Message ID:
00524500
Views:
31
Hi Chris,

How about:
SELECT mynumber, COUNT(*) AS modecount ;
    FROM mytable ;
    GROUP BY 1 ;
    ORDER BY 2 DESC ;
    INTO CURSOR mycursor
The first record in the cursor will contain the most common number.

Hope this helps,
Gavin...

>Hi All
>
>We need to calculate the mode (most commonly occurring number) from a list of values - excel can do it with the MODE() function - does anyone know if VFP can do something similar?
>
>Cheers
>
>Chris Kable
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform