Reports for Yes/No Variables - Help!

  • Thread starter Thread starter EpiAl
  • Start date Start date
E

EpiAl

I'm running reports that sum various variables. Everything is working fine
for variables that have multiple choices... for example the report will run
the number of people from each state. However, for questions that are set up
as yes/no in the table, the report wont generate a count.
The formula I am trying to use is:

=Sum(Abs([InternetAccess?]="Yes"))

for all of my other variables I use for example =Sum(Abs([State]="Illinois"))
and things work just fine.

Using "Yes" seems to be messing things up. Any ideas on what is going wrong
or how I can fix this?

Thanks!
 
EpiAl -

If the field is a Boolean field instead of a text field, then try this:

=Sum(Abs([InternetAccess?]=TRUE))
 
If you look at the table of answers, you will probably see that for Yes/NO
answers, the value in the table is either -1 or 0. -1 is True(Yes) and 0 is
False(0). Try changing your expression to:
=Sum([InternetAccess?]=-1)

What is the ? after "InternetAccess"?

Steve
(e-mail address removed)
 
I'm running reports that sum various variables. Everything is working fine
for variables that have multiple choices... for example the report will run
the number of people from each state. However, for questions that are set up
as yes/no in the table, the report wont generate a count.
The formula I am trying to use is:

=Sum(Abs([InternetAccess?]="Yes"))

for all of my other variables I use for example =Sum(Abs([State]="Illinois"))
and things work just fine.

Using "Yes" seems to be messing things up. Any ideas on what is going wrong
or how I can fix this?

Thanks!

Your quotes (="Yes" ) are incorrect.

Most likely that field is a Yes/No field meaning that it's value is a
number... -1 for Yes and 0 for No. Note there are no quotes around the
Yes or No.

You could use:
=Sum(Abs([InternetAccess?]=Yes))
or
= Sum(IIf([InternetAccess?] = -1,1,0))

Even more simply, since the value can only be a -1 or 0, just add the
field up and use Abs() to return a positive value:

=Sum(Abs([Fieldname]))

which should return the number of Yes values.
 
Back
Top