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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding null values to a group in the crosstab 1

Status
Not open for further replies.

shaleen7

MIS
Jun 23, 2002
188
US
I've created groups in a crosstab table.

DOGS 5
CATS 8
FROGS 6
OTHER (INCLUDES BLANK FIELDS (7) AND BIRDS (2)) 9


How do I include blank fields in my Other group?

I've tried "", NULL, ISNULL. Nothing seems to work.
 
That would depend upon how you're creating these groups, and what version of Crystal you're using.

One formula containing:

If {table.beast} = "DOGS" then
"DOGS"
else If {table.beast} = "CATS" then
"CATS"
else If {table.beast} = "FROGS" then
"FROGS"
ELSE
"OTHER"

Now use this formula to group on (you could also use the SWITCH function here).

-k
 
I would try:

if isnull({table.animal}) or
trim({table.animal}) = "" or
not({table.animal}) in ["Dogs","Cats","Frogs"]) then
"Other" else
{table.animal}

-LB
 
Odd, you stated that you tried isnull and "" yet LB's formula uses those and it seemingly worked.

Anyway, glad that you found a solution, I should have known it was a bad post, LB picks up on those things very well.

-k
 
Actually it didn't work. I accidentally hit the valuable post star.
 
Show us what you tried. And what are you getting that's incorrect?

Also note that I suggested that you post the version of Crystal and database, add to that sample data and expected output and you'll likely get a good result.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top