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

Problem in grouping by formula

Status
Not open for further replies.

kpiljava

Programmer
Nov 3, 2002
14
PR
I am facing a problem in grouping
I am grouping by a formula
if(not IsNull ({FIELD_01})) then
{FIELD_01}
else if(IsNull ({FIELD_01})) then
{FIELD_02}
Suppose from 100 records ,I have 3 types in FIELD_01 and 4 types of FIELD_02
The problem i am facing is that when i group based on this formula i get the 3 groups of FIELD_01 type(that is fine)
and only 1 group of FIELD_02(that is the problem)which contains all the records of all FIELD_02 types.
i should get 3 groups of FIELD_01 type and 4 groups of FIELD_02

If i reverse the formula
if(IsNull ({FIELD_01})) then
{FIELD_02}
else if(not IsNull ({FIELD_01})) then
{FIELD_01}
then i get the 4 groups of FIELD_02 type(that is fine) but only 1 group of FIELD_01(that is the problem)which contains all the records of all FIELD_01 types.
Plz tell me the way to implement this grouping correctly.
 
Show sample data and what you expect.

BTW, this:

If(IsNull ({FIELD_01})) then
{FIELD_02}
else if(not IsNull ({FIELD_01})) then
{FIELD_01}

is the same as:

If(IsNull({FIELD_01})) then
{FIELD_02}
else
{FIELD_01}

I'm guessing that what you want is to show both sets of data, try grouping on each of these fields, and suppress whatever group you'd like if it's null.

If I'm guessing poorly, provide examples of what you have and want.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top