"John " <email@example.com> wrote in message news:firstname.lastname@example.org... > dpb <email@example.com> wrote in message <firstname.lastname@example.org>... >> On 5/10/2013 3:47 PM, dpb wrote: >> ... >> >> > allData(allData.correct==1).FieldName >> >> Or, of course, if you make the field 'correct' a logical instead of >> numeric then you can dispense w/ the '==1' part and simply write >> >> allData(allData.correct).FieldName >> >> -- >> > > Hey guys thanks for your responses. > > allData(allData.correct==1) does not work because allData.correct returns > every value as a unique anser, the solution to this is > allData([allData.correct==1]) but this raises the same problem as stated > in my first post. > > The reason I allow empty values is in this case to differentiate between > correct responses, incorrect responses, and no responses.
So you're looking for a ternary state and simulating this by using the binary logical class plus empty. I'd probably switch this around and use 1 for correct answer, -1 for incorrect answer, and 0 for no answer. If you're worried about an increase in memory consumption, use int8 instead of double.