Re: Counting words for visual details
- From: Ehsanul Hoque <ehsanul_g3@xxxxxxxxxxx>
- Date: Sun, 27 Sep 2009 18:29:41 -0500
I save each answer for each user, with the visual detail in one column
and the three words in an array in a single varchar column. E.g. for
Linear a user doing the survey might pick Word1,Word2,Word3.
What would be the best way to count the words picked for let's say
Linear? And also, count the ones most frequent.
( Not sure it's best to ask here or in Rails forum but I suspect it
could be here with some array or hash trick.)
Well, if you can create the query for the word array, then you can simply use the size() method to count the objects in the array:
word_array = ['Word1', 'Word2', 'Word3'] #query here instead
word_array.size # => 3
_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009
.
- Follow-Ups:
- Re: Counting words for visual details
- From: Pål Bergström
- Re: Counting words for visual details
- References:
- Counting words for visual details
- From: Pål Bergström
- Counting words for visual details
- Prev by Date: Ruby, Windows, GTK2, and Microsoft Installer
- Next by Date: Re: handling of regexp objects that aren't referenced by variables, arrays, tables or objects
- Previous by thread: Counting words for visual details
- Next by thread: Re: Counting words for visual details
- Index(es):
Relevant Pages
|