Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A String Field Requiring A Number

Status
Not open for further replies.

BoeingSK

Technical User
Nov 2, 2007
36
0
0
US
I am creating a formula to count a field that has only Y,N, or Blank in the field. I am using fomula :

COUNT({STOCKEXT.FIELD9})="Y"
to count all of the Y's but it is giving me the error message
"A number is required here"

Up and Coming Technical Guy
 
Create conditional formulas like this:

//{@Y):
if {STOCKEXT.FIELD9}="Y" then 1

//{@null/blank}:
if isnull({STOCKEXT.FIELD9}) or
trim({STOCKEXT.FIELD9})="" then 1

Repeat for {@N}. Add these formulas to your detail section and then right click on each and insert a summary (a SUM, NOT a count).

-LB
 
Thanks Lbass, but I was able to do a count on :
if {STOCKEXT.FIELD9} = "Y" then 1 else 0
Then I will sum this up. I'll not your reference in the future. Thanks.

Up and Coming Technical Guy
 
You should NOT count a conditional formula, as it will merely tell you how many times a formula executes--unless you have it set up in a specific way to return nulls when a record does meet the criteria.

-LB
 
Yes sir, sorry I mean I summed it which only counted my "1"'s for each Y.

Up and Coming Technical Guy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top