I am using CR10 and an access database created by users so I am forced to code around the table set up.
The users have a questionnaire that they rank each question, either 1, 0, or NA. When the value is NA there is a null in the field in the database. There are 40 different questions that are ranked and they store these as individual fields in the table.
The table is set up as follows:
Name varchar(50)
Date datetime
Survey varchar(50)
101 number
102 number
103 number
104 number
105 number
106....... all the way up to 40 fields.
I need to get the following % to display on a chart by the month:
total# of 1's/total# of 1's & 0's
I need to exclude the null fields because they shouldn't be counted as part of the %.
I've tried running totals but the final formula to calculate the percentage will not appear as a selection to display on the chart.
I then tried formulas, with the report grouped by month & then counted each instance of 1 and each instance of 0 for each of the 40 questions, yes 80 formulas! This works until it runs across a field that has all nulls. Then the final % doesn't display at all.
In the initial counting formula I have tried to code against nulls, per a previous posting using the @null formula, and this still isn't working:
@101-0
if {Surveytable.101} = 0 then 1
else if isnull({Surveytable.101}) then tonumber({@null});
@101-1
if {Surveytable.101} = 1 then 1
else if isnull({Surveytable.101}) then tonumber({@null});
I know there has to be an easier way, just can't come up with it today, any suggestions??
The users have a questionnaire that they rank each question, either 1, 0, or NA. When the value is NA there is a null in the field in the database. There are 40 different questions that are ranked and they store these as individual fields in the table.
The table is set up as follows:
Name varchar(50)
Date datetime
Survey varchar(50)
101 number
102 number
103 number
104 number
105 number
106....... all the way up to 40 fields.
I need to get the following % to display on a chart by the month:
total# of 1's/total# of 1's & 0's
I need to exclude the null fields because they shouldn't be counted as part of the %.
I've tried running totals but the final formula to calculate the percentage will not appear as a selection to display on the chart.
I then tried formulas, with the report grouped by month & then counted each instance of 1 and each instance of 0 for each of the 40 questions, yes 80 formulas! This works until it runs across a field that has all nulls. Then the final % doesn't display at all.
In the initial counting formula I have tried to code against nulls, per a previous posting using the @null formula, and this still isn't working:
@101-0
if {Surveytable.101} = 0 then 1
else if isnull({Surveytable.101}) then tonumber({@null});
@101-1
if {Surveytable.101} = 1 then 1
else if isnull({Surveytable.101}) then tonumber({@null});
I know there has to be an easier way, just can't come up with it today, any suggestions??