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

sorting null values last in the group

Status
Not open for further replies.

littleress

Technical User
Apr 10, 2008
21
US
I've got a very simple report and it's a "by age" report. Currently though, the ages have the null values first if the user didn't put in birthdates. How do I tell the group that I want the null values last???
Thank you so much!
 
Are you grouping them based on any field.
If it is grouped already create one more group inside .


write a formula like
if isnull(birthday)= false then "notnull"
else "null"

in the groupexpert create a group based on this formula.

Supress the groupheader and footer.

Hope that helps if i got you right.
 
That seems complicated just to say nulls last. I know how to do it in sql, but just not in Crystal.
It is currently grouped by age. There is a formula field that says take todays date and subtract their birthdate to calculate their age. Then it is grouped by this field so that the group footer counts how many people are in each grouping eg. 5 in '34', 8 in '35, 20 in '40'. But they are not required to fill in the date of birth and sometime my clients need to know which people don't have this field filled in, so the nulls need to be on the report, but rather than them taking up the first 2 pages, I'd rather have them at the end of the report. Is this possible? Does that make more sense?
 
Set up the formula so that nulls translate to some high number for age, e.g.:

//{@birthdate}
if isnull({table.dob}) then
date(1800,1,1) else
{table.dob}

Then use this formula in your age groups, but identify the results as "Unknown."

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top